diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-19 13:55:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-19 13:55:39 +0000 |
commit | 77406964dd1c296e7ad26b2ef4c348048e193234 (patch) | |
tree | e855ba9dd905f36b24822e443ea60478b8c473fc /plugins/TabSRMM | |
parent | fe3e180e32fe8461031e05a9d59914707d1ad8f6 (diff) |
variable names' normalization
git-svn-id: http://svn.miranda-ng.org/main/trunk@11531 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/TSButton.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/main.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/services.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/tools.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/window.cpp | 24 | ||||
-rw-r--r-- | plugins/TabSRMM/src/contactcache.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 10 | ||||
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 21 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 103 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.h | 42 | ||||
-rw-r--r-- | plugins/TabSRMM/src/hotkeyhandler.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/mim.cpp | 10 | ||||
-rw-r--r-- | plugins/TabSRMM/src/mim.h | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 28 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 11 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 62 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sidebar.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/tabctrl.cpp | 2 |
21 files changed, 168 insertions, 175 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 8c5c6cdcbc..c0eed44e62 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -255,7 +255,7 @@ nonflat_themed: if (ctl->arrow)
ix -= 4;
- if (ctl->bDimmed && PluginConfig.m_IdleDetect)
+ if (ctl->bDimmed && PluginConfig.m_bIdleDetect)
CSkin::DrawDimmedIcon(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hIconNew, 180);
else {
if (ctl->stateId != PBS_DISABLED) {
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index a0fc1f05f9..9ba7933d6f 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -579,7 +579,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) int iOff = DPISCALEY_S((PluginConfig.g_DPIscaleY > 1.0) ? (dat->bType == SESSIONTYPE_IM ? 22 : 23) : 22); int foravatar = 0; - if ((rect.bottom - ptSplitter.y - (rcSplitter.bottom - rcSplitter.top) /*- DPISCALEY(2)*/ - (bBottomToolbar ? DPISCALEY_S(24) : 0) < dat->pic.cy - DPISCALEY_S(2)) && dat->bShowAvatar && !PluginConfig.m_AlwaysFullToolbarWidth) + if ((rect.bottom - ptSplitter.y - (rcSplitter.bottom - rcSplitter.top) /*- DPISCALEY(2)*/ - (bBottomToolbar ? DPISCALEY_S(24) : 0) < dat->pic.cy - DPISCALEY_S(2)) && dat->bShowAvatar && !PluginConfig.m_bAlwaysFullToolbarWidth) foravatar = dat->pic.cx + gap; if ((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT)) { diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 0256e0e614..5deaa0f1a0 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -132,7 +132,7 @@ static void OnLoadSettings() g_Settings.UserListColors[CHAT_STATUS_NORMAL] = M.GetDword(CHATFONT_MODULE, "Font18Col", RGB(0, 0, 0));
g_Settings.UserListColors[CHAT_STATUS_AWAY] = M.GetDword(CHATFONT_MODULE, "Font19Col", RGB(170, 170, 170));
g_Settings.UserListColors[CHAT_STATUS_OFFLINE] = M.GetDword(CHATFONT_MODULE, "Font5Col", RGB(160, 90, 90));
- g_Settings.bBBCodeInPopups = M.GetByte(CHAT_MODULE, "BBCodeInPopups", 0) != 0;
+ g_Settings.bBBCodeInPopups = M.GetBool(CHAT_MODULE, "BBCodeInPopups", false);
g_Settings.bClassicIndicators = M.GetBool(CHAT_MODULE, "ClassicIndicators", false);
g_Settings.bLogClassicIndicators = M.GetBool(CHAT_MODULE, "LogClassicIndicators", false);
g_Settings.bAlternativeSorting = M.GetBool(CHAT_MODULE, "AlternativeSorting", true);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 9de06558f3..4a2a61b2b8 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -122,7 +122,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT }
}
if (bActivateTab) {
- if (PluginConfig.m_HideOnClose && !IsWindowVisible(pContainer->hwnd)) {
+ if (PluginConfig.m_bHideOnClose && !IsWindowVisible(pContainer->hwnd)) {
WINDOWPLACEMENT wp = { 0 };
wp.length = sizeof(wp);
GetWindowPlacement(pContainer->hwnd, &wp);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 3c8e9d4c9e..18674a953b 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -171,7 +171,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce) }
if (dat && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck) { // no popups at all for open windows... no exceptions
- if (!PluginConfig.m_HideOnClose)
+ if (!PluginConfig.m_bHideOnClose)
return 0;
if (pContainer->fHidden)
goto passed;
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 31867c1649..c0af6f6c0a 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -225,7 +225,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) if (dat->dwFlags & MWF_NEEDCHECKSIZE) PostMessage(hwndDlg, DM_SAVESIZE, 0, 0); - if (PluginConfig.m_AutoLocaleSupport) { + if (PluginConfig.m_bAutoLocaleSupport) { if (dat->hkl == 0) DM_LoadLocale(dat); else @@ -651,7 +651,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, BOOL isShift, isAlt, isCtrl; KbdState(mwdat, isShift, isCtrl, isAlt); - if (PluginConfig.g_bSoundOnTyping && !isAlt &&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND) && wParam != VK_ESCAPE&&!(wParam == VK_TAB&&PluginConfig.m_AllowTab)) + if (PluginConfig.m_bSoundOnTyping && !isAlt &&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND) && wParam != VK_ESCAPE&&!(wParam == VK_TAB&&PluginConfig.m_bAllowTab)) SkinPlaySound("SoundOnTyping"); if (isCtrl && !isAlt && !isShift) { @@ -717,7 +717,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, KbdState(mwdat, isShift, isCtrl, isAlt); // sound on typing.. - if (PluginConfig.g_bSoundOnTyping&&!isAlt&&wParam == VK_DELETE) + if (PluginConfig.m_bSoundOnTyping&&!isAlt&&wParam == VK_DELETE) SkinPlaySound("SoundOnTyping"); if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) { @@ -759,22 +759,22 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (wParam == VK_RETURN) { if (isShift) { - if (PluginConfig.m_SendOnShiftEnter) { + if (PluginConfig.m_bSendOnShiftEnter) { PostMessage(hwndParent, WM_COMMAND, IDOK, 0); return 0; } break; } - if ((isCtrl && !isShift) ^(0 != PluginConfig.m_SendOnEnter)) { + if ((isCtrl && !isShift) ^(0 != PluginConfig.m_bSendOnEnter)) { PostMessage(hwndParent, WM_COMMAND, IDOK, 0); return 0; } - if (!PluginConfig.m_SendOnEnter && !PluginConfig.m_SendOnDblEnter) + if (!PluginConfig.m_bSendOnEnter && !PluginConfig.m_bSendOnDblEnter) break; if (isCtrl) break; - if (PluginConfig.m_SendOnDblEnter) { + if (PluginConfig.m_bSendOnDblEnter) { if (dat->lastEnterTime + 2 < time(NULL)) { dat->lastEnterTime = time(NULL); break; @@ -804,7 +804,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, bool fCompleted = TabAutoComplete(hwnd, dat, Parentsi); SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE); - if (!fCompleted && !PluginConfig.m_AllowTab) { + if (!fCompleted && !PluginConfig.m_bAllowTab) { if ((GetSendButtonState(mwdat->hwnd) != PBS_DISABLED)) SetFocus(GetDlgItem(mwdat->hwnd, IDOK)); else @@ -977,7 +977,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; case WM_INPUTLANGCHANGE: - if (PluginConfig.m_AutoLocaleSupport && GetFocus() == hwnd && mwdat->pContainer->hwndActive == hwndParent && GetForegroundWindow() == mwdat->pContainer->hwnd && GetActiveWindow() == mwdat->pContainer->hwnd) { + if (PluginConfig.m_bAutoLocaleSupport && GetFocus() == hwnd && mwdat->pContainer->hwndActive == hwndParent && GetForegroundWindow() == mwdat->pContainer->hwnd && GetActiveWindow() == mwdat->pContainer->hwnd) { DM_SaveLocale(mwdat, wParam, lParam); SendMessage(hwnd, EM_SETLANGOPTIONS, 0, (LPARAM)SendMessage(hwnd, EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD); return 1; @@ -3254,7 +3254,7 @@ LABEL_SHOWWINDOW: SendMessage(dat->pContainer->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); return TRUE; } - if (PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) { + if (PluginConfig.m_bHideOnClose && PluginConfig.m_EscapeCloses == 2) { ShowWindow(dat->pContainer->hwnd, SW_HIDE); return TRUE; } @@ -3348,7 +3348,7 @@ LABEL_SHOWWINDOW: case DM_SETLOCALE: if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) break; - if (dat->pContainer->hwndActive == hwndDlg && PluginConfig.m_AutoLocaleSupport && dat->hContact != 0 && dat->pContainer->hwnd == GetForegroundWindow() && dat->pContainer->hwnd == GetActiveWindow()) { + if (dat->pContainer->hwndActive == hwndDlg && PluginConfig.m_bAutoLocaleSupport && dat->hContact != 0 && dat->pContainer->hwnd == GetForegroundWindow() && dat->pContainer->hwnd == GetActiveWindow()) { if (lParam) dat->hkl = (HKL)lParam; @@ -3375,7 +3375,7 @@ LABEL_SHOWWINDOW: POINT pt = {0}; SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETSCROLLPOS, 0, (LPARAM)&pt); - if (PluginConfig.m_AutoLocaleSupport) { + if (PluginConfig.m_bAutoLocaleSupport) { if (dat->hkl == 0) DM_LoadLocale(dat); else diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 1483d13b46..e10289c300 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -440,7 +440,7 @@ void CContactCache::deletedHandler() */ void CContactCache::updateFavorite() { - m_isFavorite = db_get_b(m_hContact, SRMSGMOD_T, "isFavorite", 0) != 0; + m_isFavorite = M.GetBool(m_hContact, "isFavorite", false); m_isRecent = M.GetDword(m_hContact, "isRecent", 0) ? true : false; } diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index fcb498da2e..03cf179670 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1680,7 +1680,7 @@ panel_found: break; case WM_CLOSE: - if (PluginConfig.m_HideOnClose && !lParam) { + if (PluginConfig.m_bHideOnClose && !lParam) { ShowWindow(hwndDlg, SW_HIDE); pContainer->fHidden = true; } @@ -1951,7 +1951,7 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat) int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size) { - size_t cutMax = PluginConfig.m_CutContactNameTo; + size_t cutMax = PluginConfig.m_iTabNameLimit; if (mir_tstrlen(oldname) <= cutMax) _tcsncpy_s(newname, size, oldname, _TRUNCATE); @@ -2279,16 +2279,16 @@ void TSAPI BroadCastContainer(const TContainerData *pContainer, UINT message, WP void TSAPI CloseAllContainers() { - BOOL fOldHideSetting = PluginConfig.m_HideOnClose; + bool fOldHideSetting = PluginConfig.m_bHideOnClose; while (pFirstContainer != NULL) { if (!IsWindow(pFirstContainer->hwnd)) pFirstContainer = pFirstContainer->pNext; else { - PluginConfig.m_HideOnClose = FALSE; + PluginConfig.m_bHideOnClose = false; ::SendMessage(pFirstContainer->hwnd, WM_CLOSE, 0, 1); } } - PluginConfig.m_HideOnClose = fOldHideSetting; + PluginConfig.m_bHideOnClose = fOldHideSetting; } diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 1e27948dd0..135e812501 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -997,7 +997,7 @@ static void LoadKLThread(LPVOID _param) void TSAPI DM_LoadLocale(TWindowData *dat) { - if (dat == NULL || !PluginConfig.m_AutoLocaleSupport) + if (dat == NULL || !PluginConfig.m_bAutoLocaleSupport) return; if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) @@ -1008,7 +1008,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat) db_free(&dbv); else { TCHAR szKLName[KL_NAMELENGTH + 1]; - if (!PluginConfig.m_dontUseDefaultKbd) { + if (!PluginConfig.m_bDontUseDefaultKbd) { TCHAR szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); mir_sntprintf(szKLName, SIZEOF(szKLName), _T("0000%s"), szBuf); @@ -1083,7 +1083,7 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam) if (!dat) return; - if (PluginConfig.m_AutoLocaleSupport && dat->hContact && dat->pContainer->hwndActive == dat->hwnd) { + if (PluginConfig.m_bAutoLocaleSupport && dat->hContact && dat->pContainer->hwndActive == dat->hwnd) { TCHAR szKLName[KL_NAMELENGTH + 1]; if ((HKL)lParam != dat->hkl) { dat->hkl = (HKL)lParam; @@ -1147,7 +1147,7 @@ HWND TSAPI DM_CreateClist(TWindowData *dat) SetWindowLongPtr(hwndClist, GWL_EXSTYLE, GetWindowLongPtr(hwndClist, GWL_EXSTYLE) & ~CLS_EX_TRACKSELECT); SetWindowLongPtr(hwndClist, GWL_EXSTYLE, GetWindowLongPtr(hwndClist, GWL_EXSTYLE) | (CLS_EX_NOSMOOTHSCROLLING | CLS_EX_NOTRANSLUCENTSEL)); - if (!PluginConfig.m_AllowOfflineMultisend) + if (!PluginConfig.m_bAllowOfflineMultisend) SetWindowLongPtr(hwndClist, GWL_STYLE, GetWindowLongPtr(hwndClist, GWL_STYLE) | CLS_HIDEOFFLINE); if (hItem) @@ -1587,11 +1587,11 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) // set the message log divider to mark new (maybe unseen) messages, if the container has // been minimized or in the background. if (!(dbei.flags & DBEF_SENT) && !bIsStatusChangeEvent) { - if (PluginConfig.m_DividersUsePopupConfig && PluginConfig.m_UseDividers) { + if (PluginConfig.m_bDividersUsePopupConfig && PluginConfig.m_bUseDividers) { if (!MessageWindowOpened(dat->hContact, 0)) SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0); } - else if (PluginConfig.m_UseDividers) { + else if (PluginConfig.m_bUseDividers) { if ((GetForegroundWindow() != hwndContainer || GetActiveWindow() != hwndContainer)) SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0); else { @@ -1651,7 +1651,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) // never switch for status changes... if (!(dbei.flags & DBEF_SENT) && !bIsStatusChangeEvent) { if (PluginConfig.haveAutoSwitch() && m_pContainer->hwndActive != hwndDlg) { - if ((IsIconic(hwndContainer) && !IsZoomed(hwndContainer)) || (PluginConfig.m_HideOnClose && !IsWindowVisible(m_pContainer->hwnd))) { + if ((IsIconic(hwndContainer) && !IsZoomed(hwndContainer)) || (PluginConfig.m_bHideOnClose && !IsWindowVisible(m_pContainer->hwnd))) { int iItem = GetTabIndexFromHWND(GetParent(hwndDlg), hwndDlg); if (iItem >= 0) { TabCtrl_SetCurSel(GetParent(hwndDlg), iItem); @@ -1760,7 +1760,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); if (lParam != 0) { - if (PluginConfig.m_CutContactNameOnTabs) + if (PluginConfig.m_bCutContactNameOnTabs) CutContactName(szNick, newcontactname, SIZEOF(newcontactname)); else _tcsncpy_s(newcontactname, szNick, _TRUNCATE); @@ -1768,13 +1768,12 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) Utils::DoubleAmpersands(newcontactname); if (mir_tstrlen(newcontactname) != 0 && dat->szStatus != NULL) { - if (PluginConfig.m_StatusOnTabs) + if (PluginConfig.m_bStatusOnTabs) mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s (%s)"), newcontactname, dat->szStatus); else _tcsncpy_s(newtitle, newcontactname, _TRUNCATE); } - else - _tcsncpy_s(newtitle, _T("Forward"), _TRUNCATE); + else _tcsncpy_s(newtitle, _T("Forward"), _TRUNCATE); item.mask |= TCIF_TEXT; } diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 1f5c5cb273..920624e3f2 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -42,8 +42,8 @@ TCHAR* CGlobals::m_default_container_name = _T("default"); extern HANDLE hHookButtonPressedEvt;
extern HANDLE hHookToolBarLoadedEvt;
-EXCEPTION_RECORD CGlobals::m_exRecord = {0};
-CONTEXT CGlobals::m_exCtx = {0};
+EXCEPTION_RECORD CGlobals::m_exRecord = { 0 };
+CONTEXT CGlobals::m_exCtx = { 0 };
LRESULT CGlobals::m_exLastResult = 0;
char CGlobals::m_exSzFile[MAX_PATH] = "\0";
wchar_t CGlobals::m_exReason[256] = L"\0";
@@ -64,10 +64,10 @@ bool CGlobals::m_exAllowContinue = false; static char *szFLUpdateurl = "http://miranda-ng.org/";
#endif
-/**
- * reload system values. These are read ONCE and are not allowed to change
- * without a restart
- */
+/////////////////////////////////////////////////////////////////////////////////////////
+// reload system values. These are read ONCE and are not allowed to change
+// without a restart
+
void CGlobals::reloadSystemStartup()
{
m_WinVerMajor = WinVerMajor();
@@ -155,17 +155,17 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m_ncm, 0);
- m_SendOnShiftEnter = M.GetByte("sendonshiftenter", 0);
- m_SendOnEnter = M.GetByte(SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER);
- m_SendOnDblEnter = M.GetByte("SendOnDblEnter", 0);
- m_AutoLocaleSupport = M.GetByte("al", 0);
- m_AutoSwitchTabs = M.GetByte("autoswitchtabs", 1);
- m_CutContactNameTo = db_get_w(NULL, SRMSGMOD_T, "cut_at", 15);
- m_CutContactNameOnTabs = M.GetByte("cuttitle", 0);
- m_StatusOnTabs = M.GetByte("tabstatus", 1);
- m_LogStatusChanges = M.GetByte("logstatuschanges", 0);
- m_UseDividers = M.GetByte("usedividers", 0);
- m_DividersUsePopupConfig = M.GetByte("div_popupconfig", 0);
+ m_bSendOnShiftEnter = M.GetBool("sendonshiftenter", false);
+ m_bSendOnEnter = M.GetBool(SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER);
+ m_bSendOnDblEnter = M.GetBool("SendOnDblEnter", false);
+ m_bAutoLocaleSupport = M.GetBool("al", false);
+ m_bAutoSwitchTabs = M.GetBool("autoswitchtabs", true);
+ m_iTabNameLimit = db_get_w(NULL, SRMSGMOD_T, "cut_at", 15);
+ m_bCutContactNameOnTabs = M.GetBool("cuttitle", false);
+ m_bStatusOnTabs = M.GetBool("tabstatus", true);
+ m_bLogStatusChanges = M.GetBool("logstatuschanges", false);
+ m_bUseDividers = M.GetBool("usedividers", false);
+ m_bDividersUsePopupConfig = M.GetBool("div_popupconfig", false);
m_MsgTimeout = M.GetDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
if (m_MsgTimeout < SRMSGSET_MSGTIMEOUT_MIN)
@@ -173,21 +173,18 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_EscapeCloses = M.GetByte("escmode", 0);
- m_HideOnClose = M.GetByte("hideonclose", 0);
- m_AllowTab = M.GetByte("tabmode", 0);
+ m_bHideOnClose = M.GetBool("hideonclose", false);
+ m_bAllowTab = M.GetBool("tabmode", false);
- m_FlashOnClist = M.GetByte("flashcl", 0);
- m_AlwaysFullToolbarWidth = M.GetByte("alwaysfulltoolbar", 1);
+ m_bFlashOnClist = M.GetBool("flashcl", false);
+ m_bAlwaysFullToolbarWidth = M.GetBool("alwaysfulltoolbar", true);
m_LimitStaticAvatarHeight = M.GetDword("avatarheight", 96);
m_SendFormat = M.GetByte("sendformat", 0);
- m_FormatWholeWordsOnly = 1;
- m_RTLDefault = M.GetByte("rtldefault", 0);
m_TabAppearance = M.GetDword("tabconfig", TCF_FLASHICON | TCF_SINGLEROWTABCONTROL);
m_panelHeight = (DWORD)M.GetDword("panelheight", CInfoPanel::DEGRADE_THRESHOLD);
m_MUCpanelHeight = M.GetDword(CHAT_MODULE, "panelheight", CInfoPanel::DEGRADE_THRESHOLD);
- m_IdleDetect = M.GetByte("dimIconsForIdleContacts", 1);
- m_smcxicon = 16;
- m_smcyicon = 16;
+ m_bIdleDetect = M.GetBool("dimIconsForIdleContacts", true);
+ m_smcxicon = m_smcyicon = 16;
m_PasteAndSend = M.GetByte("pasteandsend", 1);
m_LangPackCP = ServiceExists(MS_LANGPACK_GETCODEPAGE) ? CallService(MS_LANGPACK_GETCODEPAGE, 0, 0) : CP_ACP;
m_visualMessageSizeIndicator = M.GetByte("msgsizebar", 0);
@@ -228,14 +225,14 @@ void CGlobals::reloadSettings(bool fReloadSkins) void CGlobals::reloadAdv()
{
- g_bSoundOnTyping = M.GetByte("adv_soundontyping", 0);
- m_dontUseDefaultKbd = M.GetByte("adv_leaveKeyboardAlone", 1);
+ m_bSoundOnTyping = M.GetBool("adv_soundontyping", false);
+ m_bDontUseDefaultKbd = M.GetBool("adv_leaveKeyboardAlone", true);
- if (g_bSoundOnTyping && m_TypingSoundAdded == false) {
+ if (m_bSoundOnTyping && m_TypingSoundAdded == false) {
SkinAddNewSoundEx("SoundOnTyping", LPGEN("Other"), LPGEN("TabSRMM: Typing"));
m_TypingSoundAdded = true;
}
- m_AllowOfflineMultisend = M.GetByte("AllowOfflineMultisend", 0);
+ m_bAllowOfflineMultisend = M.GetBool("AllowOfflineMultisend", false);
}
const HMENU CGlobals::getMenuBar()
@@ -268,7 +265,7 @@ void CGlobals::hookSystemEvents() int CGlobals::TopToolbarLoaded(WPARAM,LPARAM)
{
- TTBButton ttb = {0};
+ TTBButton ttb = { 0 };
ttb.cbSize = sizeof(ttb);
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
ttb.pszService = MS_TABMSG_TRAYSUPPORT;
@@ -286,9 +283,8 @@ int CGlobals::TopToolbarLoaded(WPARAM,LPARAM) return 0;
}
-/**
- * second part of the startup initialisation. All plugins are now fully loaded
- */
+/////////////////////////////////////////////////////////////////////////////////////////
+// second part of the startup initialisation.All plugins are now fully loaded
int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
@@ -297,17 +293,17 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) Skin->Init(true);
CSkin::initAeroEffect();
- for (int i=0; i < NR_BUTTONBARICONS; i++)
+ for (int i = 0; i < NR_BUTTONBARICONS; i++)
PluginConfig.g_buttonBarIcons[i] = 0;
::LoadIconTheme();
::CreateImageList(TRUE);
- MENUITEMINFOA mii = {0};
+ MENUITEMINFOA mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_BITMAP;
mii.hbmpItem = HBMMENU_CALLBACK;
HMENU submenu = GetSubMenu(PluginConfig.g_hMenuContext, 7);
- for (int k=0; k <= 8; k++)
+ for (int k = 0; k <= 8; k++)
SetMenuItemInfoA(submenu, (UINT_PTR)k, TRUE, &mii);
PluginConfig.reloadSystemModulesChanged();
@@ -323,7 +319,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) db_set_b(0, SRMSGMOD_T, "avatarmode", 2);
PluginConfig.g_hwndHotkeyHandler = CreateWindowEx(0, _T("TSHK"), _T(""), WS_POPUP,
- 0, 0, 40, 40, 0, 0, g_hInst, NULL);
+ 0, 0, 40, 40, 0, 0, g_hInst, NULL);
::CreateTrayMenus(TRUE);
if (nen_options.bTraySupport)
@@ -373,7 +369,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
const char *szProto = NULL;
const char *setting = cws->szSetting;
CContactCache* c = 0;
@@ -521,7 +517,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM, LPARAM) ::UnregisterClass(_T("TSStatusBarClass"), g_hInst);
::UnregisterClass(_T("SideBarClass"), g_hInst);
- ::UnregisterClassA("TSTabCtrlClass", g_hInst);
+ ::UnregisterClass(_T("TSTabCtrlClass"), g_hInst);
::UnregisterClass(_T("RichEditTipClass"), g_hInst);
::UnregisterClass(_T("TSHK"), g_hInst);
return 0;
@@ -541,21 +537,19 @@ int CGlobals::OkToExit(WPARAM, LPARAM) return 0;
}
-/**
- * used on startup to restore flashing tray icon if one or more messages are
- * still "unread"
- */
+/////////////////////////////////////////////////////////////////////////////////////////
+// used on startup to restore flashing tray icon if one or more messages are still "unread"
void CGlobals::RestoreUnreadMessageAlerts(void)
{
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = { sizeof(cle) };
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_TCHAR;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_dw(hContact, "SendLater", "count", 0))
- sendLater->addContact(hContact);
+ sendLater->addContact(hContact);
HANDLE hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
@@ -588,12 +582,10 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) return;
MCONTACT hContact = c->getContact();
- if (!PluginConfig.m_LogStatusChanges && !M.GetByte(hContact, "logstatuschanges", 0))
+ if (!PluginConfig.m_bLogStatusChanges && !M.GetByte(hContact, "logstatuschanges", 0))
return;
- /*
- * don't log them if WE are logging off
- */
+ // don't log them if WE are logging off
if (CallProtoService(c->getProto(), PS_GETSTATUS, 0, 0) == ID_STATUS_OFFLINE)
return;
@@ -622,7 +614,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) dbei.flags = DBEF_UTF | DBEF_READ;
dbei.eventType = EVENTTYPE_STATUSCHANGE;
dbei.timestamp = time(NULL);
- dbei.szModule = const_cast<char *>(c->getProto());
+ dbei.szModule = (char*)c->getProto();
StreamInEvents(dat->hwnd, NULL, 1, 1, &dbei);
}
@@ -634,9 +626,8 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) bool CGlobals::haveAutoSwitch()
{
- if (m_bIsWin7) {
- if (m_useAeroPeek && !CSkin::m_skinEnabled)
- return false;
- }
- return(m_AutoSwitchTabs ? true : false);
+ if (m_bIsWin7 && m_useAeroPeek && !CSkin::m_skinEnabled)
+ return false;
+
+ return m_bAutoSwitchTabs;
}
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index 73ee0d1438..cc44205739 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -82,36 +82,36 @@ public: HANDLE g_buttonBarIconHandles[23];
// dynamic options, need reload when options change
- int m_SendOnShiftEnter;
- int m_SendOnEnter;
- int m_SendOnDblEnter;
- int m_AutoLocaleSupport;
- int m_AutoSwitchTabs;
- int m_CutContactNameOnTabs;
- int m_CutContactNameTo;
- int m_StatusOnTabs;
- int m_LogStatusChanges;
- int m_UseDividers;
- int m_DividersUsePopupConfig;
+ int m_iTabNameLimit;
+ bool m_bAllowTab;
+ bool m_bSendOnShiftEnter;
+ bool m_bSendOnEnter;
+ bool m_bSendOnDblEnter;
+ bool m_bAutoLocaleSupport;
+ bool m_bAutoSwitchTabs;
+ bool m_bCutContactNameOnTabs;
+ bool m_bHideOnClose;
+ bool m_bStatusOnTabs;
+ bool m_bLogStatusChanges;
+ bool m_bUseDividers;
+ bool m_bSoundOnTyping;
+ bool m_bAllowOfflineMultisend;
+ bool m_bDividersUsePopupConfig;
+ bool m_bFlashOnClist;
+ bool m_bAlwaysFullToolbarWidth;
+ bool m_bIdleDetect;
+ bool m_bDontUseDefaultKbd;
+
int m_MsgTimeout;
int m_EscapeCloses;
- int m_FlashOnClist;
- int m_AlwaysFullToolbarWidth;
int m_LimitStaticAvatarHeight;
int m_SendFormat;
- int m_FormatWholeWordsOnly;
- int m_RTLDefault;
int m_UnreadInTray;
int m_TrayFlashes;
int m_TrayFlashState;
- BOOL m_SuperQuiet;
HANDLE m_UserMenuItem;
double g_DPIscaleX;
double g_DPIscaleY;
- BOOL m_HideOnClose;
- BOOL g_bSoundOnTyping;
- BOOL m_AllowTab;
- BYTE m_AllowOfflineMultisend;
HBITMAP m_hbmMsgArea;
BYTE g_iButtonsBarGap;
BYTE m_WinVerMajor;
@@ -121,7 +121,6 @@ public: int m_TabAppearance;
myTabCtrl tabConfig;
int m_panelHeight, m_MUCpanelHeight;
- int m_IdleDetect;
int m_smcxicon, m_smcyicon;
int m_PasteAndSend;
COLORREF crIncoming, crOutgoing, crOldIncoming, crOldOutgoing, crStatus;
@@ -139,7 +138,6 @@ public: COLORREF m_ipBackgroundGradient;
COLORREF m_ipBackgroundGradientHigh;
COLORREF m_tbBackgroundHigh, m_tbBackgroundLow, m_fillColor, m_cRichBorders, m_genericTxtColor;
- BYTE m_dontUseDefaultKbd;
HANDLE m_event_MsgWin, m_event_MsgPopup, m_event_WriteEvent;
HGENMENU m_hMenuItem;
BYTE m_useAeroPeek;
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 041ffbf578..bf1029a546 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -278,7 +278,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE));
}
else {
- if (PluginConfig.m_HideOnClose)
+ if (PluginConfig.m_bHideOnClose)
ShowWindow(pLastActiveContainer->hwnd, SW_HIDE);
else
SendMessage(pLastActiveContainer->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index a8442ef26f..03bac72347 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -281,7 +281,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) if (hwnd == 0) fShow = true; else { - if (PluginConfig.m_HideOnClose) { + if (PluginConfig.m_bHideOnClose) { TContainerData *pContainer = 0; SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer); if (pContainer && pContainer->fHidden) @@ -430,15 +430,15 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam) CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1); bool bAllowAutoCreate = false; - bool bAutoPopup = M.GetByte(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP) != 0; - bool bAutoCreate = M.GetByte("autotabs", 1) != 0; - bool bAutoContainer = M.GetByte("autocontainer", 1) != 0; + bool bAutoPopup = M.GetBool(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP); + bool bAutoCreate = M.GetBool("autotabs", true); + bool bAutoContainer = M.GetBool("autocontainer", true); DWORD dwStatusMask = M.GetDword("autopopupmask", -1); if (hwnd) { TContainerData *pTargetContainer = 0; SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pTargetContainer); - if (pTargetContainer == NULL || !PluginConfig.m_HideOnClose || IsWindowVisible(pTargetContainer->hwnd)) + if (pTargetContainer == NULL || !PluginConfig.m_bHideOnClose || IsWindowVisible(pTargetContainer->hwnd)) return 0; WINDOWPLACEMENT wp = { 0 }; diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index 56d9ebde8d..de661242da 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -116,8 +116,12 @@ public: static int __forceinline GetByte(const MCONTACT hContact, const char *szSetting, int uDefault)
{ return db_get_b(hContact, SRMSGMOD_T, szSetting, uDefault); }
- static bool __forceinline GetBool(const char *szModule, const char *szSetting, bool uDefault)
- { return db_get_b(0, szModule, szSetting, uDefault) != 0; }
+ static bool __forceinline GetBool(const char *szSetting, bool bDefault)
+ { return db_get_b(0, SRMSGMOD_T, szSetting, bDefault) != 0; }
+ static bool __forceinline GetBool(const char *szModule, const char *szSetting, bool bDefault)
+ { return db_get_b(0, szModule, szSetting, bDefault) != 0; }
+ static bool __forceinline GetBool(const MCONTACT hContact, const char *szSetting, bool bDefault)
+ { return db_get_b(hContact, SRMSGMOD_T, szSetting, bDefault) != 0; }
/*
* path utilities
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index ae63a18268..b7ffc7873a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -336,7 +336,7 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg) if (dat->dwFlags & MWF_NEEDCHECKSIZE) PostMessage(hwndDlg, DM_SAVESIZE, 0, 0); - if (PluginConfig.m_AutoLocaleSupport) { + if (PluginConfig.m_bAutoLocaleSupport) { if (dat->hkl == 0) DM_LoadLocale(dat); else @@ -579,7 +579,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar case WM_CHAR: KbdState(mwdat, isShift, isCtrl, isAlt); - if (PluginConfig.g_bSoundOnTyping && !isAlt && !isCtrl && !(mwdat->pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_AllowTab)) + if (PluginConfig.m_bSoundOnTyping && !isAlt && !isCtrl && !(mwdat->pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_bAllowTab)) SkinPlaySound("SoundOnTyping"); if (isCtrl && !isAlt) { @@ -632,7 +632,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar case WM_KEYDOWN: KbdState(mwdat, isShift, isCtrl, isAlt); - if (PluginConfig.g_bSoundOnTyping && !isAlt && !(mwdat->pContainer->dwFlags & CNT_NOSOUND) && wParam == VK_DELETE) + if (PluginConfig.m_bSoundOnTyping && !isAlt && !(mwdat->pContainer->dwFlags & CNT_NOSOUND) && wParam == VK_DELETE) SkinPlaySound("SoundOnTyping"); if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) { @@ -647,21 +647,21 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar break; if (isShift) { - if (PluginConfig.m_SendOnShiftEnter) { + if (PluginConfig.m_bSendOnShiftEnter) { PostMessage(hwndParent, WM_COMMAND, IDOK, 0); return 0; } else break; } - if ((isCtrl && !isShift) ^ (0 != PluginConfig.m_SendOnEnter)) { + if ((isCtrl && !isShift) ^ (0 != PluginConfig.m_bSendOnEnter)) { PostMessage(hwndParent, WM_COMMAND, IDOK, 0); return 0; } - if (PluginConfig.m_SendOnEnter || PluginConfig.m_SendOnDblEnter) { + if (PluginConfig.m_bSendOnEnter || PluginConfig.m_bSendOnDblEnter) { if (isCtrl) break; - if (PluginConfig.m_SendOnDblEnter) { + if (PluginConfig.m_bSendOnDblEnter) { LONG_PTR lastEnterTime = GetWindowLongPtr(hwnd, GWLP_USERDATA); if (lastEnterTime + 2 < time(NULL)) { lastEnterTime = time(NULL); @@ -762,7 +762,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar break; case WM_INPUTLANGCHANGE: - if (PluginConfig.m_AutoLocaleSupport && GetFocus() == hwnd && mwdat->pContainer->hwndActive == hwndParent && GetForegroundWindow() == mwdat->pContainer->hwnd && GetActiveWindow() == mwdat->pContainer->hwnd) { + if (PluginConfig.m_bAutoLocaleSupport && GetFocus() == hwnd && mwdat->pContainer->hwndActive == hwndParent && GetForegroundWindow() == mwdat->pContainer->hwnd && GetActiveWindow() == mwdat->pContainer->hwnd) { DM_SaveLocale(mwdat, wParam, lParam); SendMessage(hwnd, EM_SETLANGOPTIONS, 0, (LPARAM)SendMessage(hwnd, EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD); return 1; @@ -1031,7 +1031,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * } else dat->bUseOffset = false; - if (showToolbar && bBottomToolbar && (PluginConfig.m_AlwaysFullToolbarWidth || ((dat->pic.cy - DPISCALEY_S(6)) < rc.bottom))) { + if (showToolbar && bBottomToolbar && (PluginConfig.m_bAlwaysFullToolbarWidth || ((dat->pic.cy - DPISCALEY_S(6)) < rc.bottom))) { urc->rcItem.bottom -= DPISCALEY_S(22); if (dat->bIsAutosizingInput) { urc->rcItem.left--; @@ -1897,7 +1897,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // tabulation mod if (msg == WM_KEYDOWN && wp == VK_TAB) { - if (PluginConfig.m_AllowTab) { + if (PluginConfig.m_bAllowTab) { if (((NMHDR*)lParam)->idFrom == IDC_MESSAGE) SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)"\t"); _clrMsgFilter(lParam); @@ -2182,7 +2182,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return 0; case DM_ADDDIVIDER: - if (!(dat->dwFlags & MWF_DIVIDERSET) && PluginConfig.m_UseDividers) { + if (!(dat->dwFlags & MWF_DIVIDERSET) && PluginConfig.m_bUseDividers) { if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOG)) > 0) { dat->dwFlags |= MWF_DIVIDERWANTED; dat->dwFlags |= MWF_DIVIDERSET; @@ -2480,7 +2480,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_SETLOCALE: if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) break; - if (m_pContainer->hwndActive == hwndDlg && PluginConfig.m_AutoLocaleSupport && hwndContainer == GetForegroundWindow() && hwndContainer == GetActiveWindow()) { + if (m_pContainer->hwndActive == hwndDlg && PluginConfig.m_bAutoLocaleSupport && hwndContainer == GetForegroundWindow() && hwndContainer == GetActiveWindow()) { if (lParam) dat->hkl = (HKL)lParam; @@ -2537,7 +2537,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->dwFlags &= ~MWF_WASBACKGROUNDCREATE; SendMessage(hwndDlg, WM_SIZE, 0, 0); PostMessage(hwndDlg, DM_UPDATEPICLAYOUT, 0, 0); - if (PluginConfig.m_AutoLocaleSupport) { + if (PluginConfig.m_bAutoLocaleSupport) { if (dat->hkl == 0) DM_LoadLocale(dat); else @@ -3183,7 +3183,7 @@ quote_from_last: SendMessage(hwndContainer, WM_SYSCOMMAND, SC_MINIMIZE, 0); return TRUE; } - else if (PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) { + else if (PluginConfig.m_bHideOnClose && PluginConfig.m_EscapeCloses == 2) { ShowWindow(hwndContainer, SW_HIDE); return TRUE; } diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 9c6e91b953..dc67297ff3 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -228,7 +228,7 @@ void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo) double picAspect = (bminfo->bmWidth == 0 || bminfo->bmHeight == 0) ? 1.0 : (double)(bminfo->bmWidth / (double)bminfo->bmHeight);
double picProjectedWidth = (double)((dat->dynaSplitter - ((bBottomToolBar && bToolBar) ? DPISCALEX_S(24) : 0) + ((dat->bShowUIElements) ? DPISCALEX_S(28) : DPISCALEX_S(2)))) * picAspect;
- if ((rc.right - (int)picProjectedWidth) > (dat->iButtonBarReallyNeeds) && !PluginConfig.m_AlwaysFullToolbarWidth && bToolBar)
+ if ((rc.right - (int)picProjectedWidth) > (dat->iButtonBarReallyNeeds) && !PluginConfig.m_bAlwaysFullToolbarWidth && bToolBar)
dat->iRealAvatarHeight = dat->dynaSplitter + 3 + (dat->bShowUIElements ? DPISCALEY_S(28) : DPISCALEY_S(2));
else
dat->iRealAvatarHeight = dat->dynaSplitter + DPISCALEY_S(6) + DPISCALEY_S(iSplitOffset);
@@ -272,7 +272,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) CheckMenuItem(visMenu, ID_VISIBILITY_HIDDENFORTHISCONTACT, MF_BYCOMMAND | (avOverride == 0 ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(visMenu, ID_VISIBILITY_VISIBLEFORTHISCONTACT, MF_BYCOMMAND | (avOverride == 1 ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(submenu, ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH, MF_BYCOMMAND | (PluginConfig.m_AlwaysFullToolbarWidth ? MF_CHECKED : MF_UNCHECKED));
+ CheckMenuItem(submenu, ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH, MF_BYCOMMAND | (PluginConfig.m_bAlwaysFullToolbarWidth ? MF_CHECKED : MF_UNCHECKED));
if (!bInfoPanel) {
EnableMenuItem(submenu, ID_PICMENU_SETTINGS, MF_BYCOMMAND | (ServiceExists(MS_AV_GETAVATARBITMAP) ? MF_ENABLED : MF_GRAYED));
szText = TranslateT("Contact Picture Settings...");
@@ -360,8 +360,8 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) return 1;
case ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH:
- PluginConfig.m_AlwaysFullToolbarWidth = !PluginConfig.m_AlwaysFullToolbarWidth;
- db_set_b(0, SRMSGMOD_T, "alwaysfulltoolbar", (BYTE)PluginConfig.m_AlwaysFullToolbarWidth);
+ PluginConfig.m_bAlwaysFullToolbarWidth = !PluginConfig.m_bAlwaysFullToolbarWidth;
+ db_set_b(0, SRMSGMOD_T, "alwaysfulltoolbar", (BYTE)PluginConfig.m_bAlwaysFullToolbarWidth);
M.BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
break;
@@ -770,8 +770,9 @@ void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTIN if (hEvent == 0)
return;
- if (!PluginConfig.m_FlashOnClist)
+ if (!PluginConfig.m_bFlashOnClist)
return;
+
if ((GetForegroundWindow() != dat->pContainer->hwnd || dat->pContainer->hwndActive != hwndDlg) && !(dbei->flags & DBEF_SENT) && dbei->eventType == EVENTTYPE_MESSAGE && !(dat->dwFlagsEx & MWF_SHOW_FLASHCLIST)) {
CLISTEVENT cle = { 0 };
cle.cbSize = sizeof(cle);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index d215ed30fb..c9cd26d520 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -447,9 +447,9 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, {
HANDLE hTimeZone = NULL;
BOOL skipToNext = FALSE, skipFont = FALSE;
- struct tm event_time;
+ struct tm event_time = { 0 };
BOOL isBold = FALSE, isItalic = FALSE, isUnderline = FALSE;
- DWORD dwFormattingParams = MAKELONG(PluginConfig.m_FormatWholeWordsOnly, 0);
+ DWORD dwFormattingParams = MAKELONG(1, 0);
size_t bufferEnd = 0, bufferAlloced = 1024;
char *buffer = (char *)mir_alloc(bufferAlloced); buffer[0] = '\0';
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index fda6465060..1bc0275a01 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -586,7 +586,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, RedrawWindow(pContainer->hwndActive, NULL, NULL, RDW_ERASENOW | RDW_UPDATENOW); } - if (PluginConfig.m_HideOnClose&&!IsWindowVisible(pContainer->hwnd)) { + if (PluginConfig.m_bHideOnClose&&!IsWindowVisible(pContainer->hwnd)) { WINDOWPLACEMENT wp = { 0 }; wp.length = sizeof(wp); GetWindowPlacement(pContainer->hwnd, &wp); diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 0df153eaf8..2878a5243c 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -650,45 +650,45 @@ private: UINT mRefCounter;
};
-#define MSGFONTID_MYMSG 0
-#define MSGFONTID_MYMISC 1
-#define MSGFONTID_YOURMSG 2
-#define MSGFONTID_YOURMISC 3
-#define MSGFONTID_MYNAME 4
-#define MSGFONTID_MYTIME 5
-#define MSGFONTID_YOURNAME 6
-#define MSGFONTID_YOURTIME 7
-#define H_MSGFONTID_MYMSG 8
-#define H_MSGFONTID_MYMISC 9
-#define H_MSGFONTID_YOURMSG 10
-#define H_MSGFONTID_YOURMISC 11
-#define H_MSGFONTID_MYNAME 12
-#define H_MSGFONTID_MYTIME 13
-#define H_MSGFONTID_YOURNAME 14
-#define H_MSGFONTID_YOURTIME 15
-#define MSGFONTID_MESSAGEAREA 16
+#define MSGFONTID_MYMSG 0
+#define MSGFONTID_MYMISC 1
+#define MSGFONTID_YOURMSG 2
+#define MSGFONTID_YOURMISC 3
+#define MSGFONTID_MYNAME 4
+#define MSGFONTID_MYTIME 5
+#define MSGFONTID_YOURNAME 6
+#define MSGFONTID_YOURTIME 7
+#define H_MSGFONTID_MYMSG 8
+#define H_MSGFONTID_MYMISC 9
+#define H_MSGFONTID_YOURMSG 10
+#define H_MSGFONTID_YOURMISC 11
+#define H_MSGFONTID_MYNAME 12
+#define H_MSGFONTID_MYTIME 13
+#define H_MSGFONTID_YOURNAME 14
+#define H_MSGFONTID_YOURTIME 15
+#define MSGFONTID_MESSAGEAREA 16
#define H_MSGFONTID_STATUSCHANGES 17
-#define H_MSGFONTID_DIVIDERS 18
-#define MSGFONTID_ERROR 19
-#define MSGFONTID_SYMBOLS_IN 20
-#define MSGFONTID_SYMBOLS_OUT 21
+#define H_MSGFONTID_DIVIDERS 18
+#define MSGFONTID_ERROR 19
+#define MSGFONTID_SYMBOLS_IN 20
+#define MSGFONTID_SYMBOLS_OUT 21
-#define IPFONTID_NICK 0
-#define IPFONTID_UIN 1
-#define IPFONTID_STATUS 2
-#define IPFONTID_PROTO 3
-#define IPFONTID_TIME 4
+#define IPFONTID_NICK 0
+#define IPFONTID_UIN 1
+#define IPFONTID_STATUS 2
+#define IPFONTID_PROTO 3
+#define IPFONTID_TIME 4
-#define LOADHISTORY_UNREAD 0
-#define LOADHISTORY_COUNT 1
-#define LOADHISTORY_TIME 2
+#define LOADHISTORY_UNREAD 0
+#define LOADHISTORY_COUNT 1
+#define LOADHISTORY_TIME 2
#define SRMSGSET_AUTOPOPUP "AutoPopup"
-#define SRMSGDEFSET_AUTOPOPUP 0
+#define SRMSGDEFSET_AUTOPOPUP false
#define SRMSGSET_AUTOMIN "AutoMin"
#define SRMSGDEFSET_AUTOMIN 0
#define SRMSGSET_SENDONENTER "SendOnEnter"
-#define SRMSGDEFSET_SENDONENTER 0
+#define SRMSGDEFSET_SENDONENTER false
#define SRMSGSET_MSGTIMEOUT "MessageTimeout"
#define SRMSGDEFSET_MSGTIMEOUT 30000
#define SRMSGSET_MSGTIMEOUT_MIN 5000 // minimum value (5 seconds)
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index bcca9540e4..0509e879d5 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -259,7 +259,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const if (m_dat->mayFlashTab == FALSE || (m_dat->mayFlashTab == TRUE && m_dat->bTabFlash != 0) || !(pContainer->dwFlagsEx & TCF_FLASHICON)) {
DWORD ix = rc.left + 4;
DWORD iy = (rc.bottom + rc.top - iSize) / 2;
- if (m_dat->dwFlagsEx & MWF_SHOW_ISIDLE && PluginConfig.m_IdleDetect)
+ if (m_dat->dwFlagsEx & MWF_SHOW_ISIDLE && PluginConfig.m_bIdleDetect)
CSkin::DrawDimmedIcon(hdc, ix, iy, iSize, iSize, hIcon, 180);
else
::DrawIconEx(hdc, ix, iy, hIcon, iSize, iSize, 0, NULL, DI_NORMAL | DI_COMPAT);
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index d610f788eb..449ecb9755 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -187,7 +187,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in if (dat->mayFlashTab == FALSE || (dat->mayFlashTab == TRUE && dat->bTabFlash != 0) || !(dat->pContainer->dwFlagsEx & TCF_FLASHICON)) {
DWORD ix = rcItem->left + tabdat->m_xpad - 1;
DWORD iy = (rcItem->bottom + rcItem->top - iSize) / 2;
- if (dat->dwFlagsEx & MWF_SHOW_ISIDLE && PluginConfig.m_IdleDetect)
+ if (dat->dwFlagsEx & MWF_SHOW_ISIDLE && PluginConfig.m_bIdleDetect)
CSkin::DrawDimmedIcon(dc, ix, iy, iSize, iSize, hIcon, 180);
else
DrawIconEx(dc, ix, iy, hIcon, iSize, iSize, 0, NULL, DI_NORMAL | DI_COMPAT);
|