diff options
Diffstat (limited to 'plugins/TabSRMM/src/globals.cpp')
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index fb8d333562..160c3104d0 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -170,15 +170,15 @@ void CGlobals::reloadSystemModulesChanged() bIEView = ServiceExists(MS_IEVIEW_WINDOW);
if (bIEView) {
- BOOL bOldIEView = M->GetByte("ieview_installed", 0);
+ BOOL bOldIEView = M.GetByte("ieview_installed", 0);
if (bOldIEView != bIEView)
- M->WriteByte(SRMSGMOD_T, "default_ieview", 1);
- M->WriteByte(SRMSGMOD_T, "ieview_installed", 1);
+ db_set_b(0, SRMSGMOD_T, "default_ieview", 1);
+ db_set_b(0, SRMSGMOD_T, "ieview_installed", 1);
HookEvent(ME_IEVIEW_OPTIONSCHANGED, ::IEViewOptionsChanged);
}
- else M->WriteByte(SRMSGMOD_T, "ieview_installed", 0);
+ else db_set_b(0, SRMSGMOD_T, "ieview_installed", 0);
- g_iButtonsBarGap = M->GetByte("ButtonsBarGap", 1);
+ g_iButtonsBarGap = M.GetByte("ButtonsBarGap", 1);
m_hwndClist = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
m_MathModAvail = (ServiceExists(MATH_RTF_REPLACE_FORMULAE) ? 1 : 0);
if (m_MathModAvail) {
@@ -194,7 +194,7 @@ void CGlobals::reloadSystemModulesChanged() if (g_MetaContactsAvail) {
mir_snprintf(szMetaName, 256, "%s", (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0));
- bMetaEnabled = abs(M->GetByte(0, szMetaName, "Enabled", -1));
+ bMetaEnabled = abs(M.GetByte(szMetaName, "Enabled", -1));
}
else {
szMetaName[0] = 0;
@@ -211,7 +211,7 @@ void CGlobals::reloadSystemModulesChanged() mi.pszService = MS_MSG_SENDMESSAGE;
PluginConfig.m_hMenuItem = Menu_AddContactMenuItem(&mi);
- m_useAeroPeek = M->GetByte("useAeroPeek", 1);
+ m_useAeroPeek = M.GetByte("useAeroPeek", 1);
}
/**
@@ -223,69 +223,69 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m_ncm, 0);
- DWORD dwFlags = M->GetDword("mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
- 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_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_MsgTimeout = M->GetDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
+ 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_MsgTimeout = M.GetDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
if (m_MsgTimeout < SRMSGSET_MSGTIMEOUT_MIN)
m_MsgTimeout = SRMSGSET_MSGTIMEOUT_MIN;
- m_EscapeCloses = M->GetByte("escmode", 0);
+ m_EscapeCloses = M.GetByte("escmode", 0);
- m_HideOnClose = M->GetByte("hideonclose", 0);
- m_AllowTab = M->GetByte("tabmode", 0);
+ m_HideOnClose = M.GetByte("hideonclose", 0);
+ m_AllowTab = M.GetByte("tabmode", 0);
- m_FlashOnClist = M->GetByte("flashcl", 0);
- m_AlwaysFullToolbarWidth = M->GetByte("alwaysfulltoolbar", 1);
- m_LimitStaticAvatarHeight = M->GetDword("avatarheight", 96);
- m_SendFormat = M->GetByte("sendformat", 0);
+ m_FlashOnClist = M.GetByte("flashcl", 0);
+ m_AlwaysFullToolbarWidth = M.GetByte("alwaysfulltoolbar", 1);
+ 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", "panelheight", CInfoPanel::DEGRADE_THRESHOLD);
- m_IdleDetect = M->GetByte("dimIconsForIdleContacts", 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", "panelheight", CInfoPanel::DEGRADE_THRESHOLD);
+ m_IdleDetect = M.GetByte("dimIconsForIdleContacts", 1);
m_smcxicon = 16;
m_smcyicon = 16;
- m_PasteAndSend = M->GetByte("pasteandsend", 1);
+ m_PasteAndSend = M.GetByte("pasteandsend", 1);
m_szNoStatus = TranslateT("No status message");
m_LangPackCP = ServiceExists(MS_LANGPACK_GETCODEPAGE) ? CallService(MS_LANGPACK_GETCODEPAGE, 0, 0) : CP_ACP;
- m_visualMessageSizeIndicator = M->GetByte("msgsizebar", 0);
- m_autoSplit = M->GetByte("autosplit", 0);
- m_FlashOnMTN = M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
+ m_visualMessageSizeIndicator = M.GetByte("msgsizebar", 0);
+ m_autoSplit = M.GetByte("autosplit", 0);
+ m_FlashOnMTN = M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
if (m_MenuBar == 0) {
m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
}
- m_ipBackgroundGradient = M->GetDword(FONTMODULE, "ipfieldsbg", 0x62caff);
+ m_ipBackgroundGradient = M.GetDword(FONTMODULE, "ipfieldsbg", 0x62caff);
if (0 == m_ipBackgroundGradient)
m_ipBackgroundGradient = 0x62caff;
- m_ipBackgroundGradientHigh = M->GetDword(FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0);
+ m_ipBackgroundGradientHigh = M.GetDword(FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0);
if (0 == m_ipBackgroundGradientHigh)
m_ipBackgroundGradientHigh = 0xf0f0f0;
- m_tbBackgroundHigh = M->GetDword(FONTMODULE, "tbBgHigh", 0);
- m_tbBackgroundLow = M->GetDword(FONTMODULE, "tbBgLow", 0);
- m_fillColor = M->GetDword(FONTMODULE, "fillColor", 0);
+ m_tbBackgroundHigh = M.GetDword(FONTMODULE, "tbBgHigh", 0);
+ m_tbBackgroundLow = M.GetDword(FONTMODULE, "tbBgLow", 0);
+ m_fillColor = M.GetDword(FONTMODULE, "fillColor", 0);
if (CSkin::m_BrushFill) {
::DeleteObject(CSkin::m_BrushFill);
CSkin::m_BrushFill = 0;
}
- m_genericTxtColor = M->GetDword(FONTMODULE, "genericTxtClr", GetSysColor(COLOR_BTNTEXT));
- m_cRichBorders = M->GetDword(FONTMODULE, "cRichBorders", 0);
+ m_genericTxtColor = M.GetDword(FONTMODULE, "genericTxtClr", GetSysColor(COLOR_BTNTEXT));
+ m_cRichBorders = M.GetDword(FONTMODULE, "cRichBorders", 0);
::CopyMemory(&globalContainerSettings, &_cnt_default, sizeof(TContainerSettings));
Utils::ReadContainerSettingsFromDB(0, &globalContainerSettings);
@@ -299,15 +299,15 @@ void CGlobals::reloadSettings(bool fReloadSkins) */
void CGlobals::reloadAdv()
{
- g_bDisableAniAvatars = M->GetByte("adv_DisableAniAvatars", 0);
- g_bSoundOnTyping = M->GetByte("adv_soundontyping", 0);
- m_dontUseDefaultKbd = M->GetByte("adv_leaveKeyboardAlone", 1);
+ g_bDisableAniAvatars = M.GetByte("adv_DisableAniAvatars", 0);
+ g_bSoundOnTyping = M.GetByte("adv_soundontyping", 0);
+ m_dontUseDefaultKbd = M.GetByte("adv_leaveKeyboardAlone", 1);
if (g_bSoundOnTyping && m_TypingSoundAdded == false) {
SkinAddNewSoundEx("SoundOnTyping", LPGEN("Other"), LPGEN("TABSRMM: Typing"));
m_TypingSoundAdded = true;
}
- m_AllowOfflineMultisend = M->GetByte("AllowOfflineMultisend", 0);
+ m_AllowOfflineMultisend = M.GetByte("AllowOfflineMultisend", 0);
}
const HMENU CGlobals::getMenuBar()
@@ -345,7 +345,7 @@ void CGlobals::hookSystemEvents() int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- M->configureCustomFolders();
+ M.configureCustomFolders();
Skin->Init(true);
CSkin::initAeroEffect();
@@ -371,8 +371,8 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) ::ModPlus_Init(wParam, lParam);
::NotifyEventHooks(hHookToolBarLoadedEvt, 0, 0);
- if (M->GetByte("avatarmode", -1) == -1)
- M->WriteByte(SRMSGMOD_T, "avatarmode", 2);
+ if (M.GetByte("avatarmode", -1) == -1)
+ 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);
@@ -434,7 +434,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) CContactCache* c = 0;
bool fChanged = false, fNickChanged = false, fExtendedStatusChange = false;
- hwnd = M->FindWindow((HANDLE)wParam);
+ hwnd = M.FindWindow((HANDLE)wParam);
if (hwnd == 0 && wParam != 0) { // we are not interested in this event if there is no open message window/tab
if (!strcmp(setting, "Status") || !strcmp(setting, "MyHandle") || !strcmp(setting, "Nick") || !strcmp(cws->szModule, SRMSGMOD_T)) {
@@ -451,7 +451,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) }
if (wParam == 0 && !strcmp("Nick", setting)) {
- M->BroadcastMessage(DM_OWNNICKCHANGED, 0, (LPARAM)cws->szModule);
+ M.BroadcastMessage(DM_OWNNICKCHANGED, 0, (LPARAM)cws->szModule);
return 0;
}
@@ -468,7 +468,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) if (wParam == 0 && !lstrcmpA(setting, "Enabled")) {
if (PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName)) { // catch the disabled meta contacts
- PluginConfig.bMetaEnabled = abs(M->GetByte(0, PluginConfig.szMetaName, "Enabled", -1));
+ PluginConfig.bMetaEnabled = abs(M.GetByte(PluginConfig.szMetaName, "Enabled", -1));
cacheUpdateMetaChanged();
}
}
@@ -577,7 +577,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam) }
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- M->WriteDword(hContact, SRMSGMOD_T, "messagecount", 0);
+ db_set_dw(hContact, SRMSGMOD_T, "messagecount", 0);
::SI_DeinitStatusIcons();
::CB_DeInitCustomButtons();
@@ -642,7 +642,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) cle.flags = CLEF_TCHAR;
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if (M->GetDword(hContact, "SendLater", "count", 0))
+ if (db_get_dw(hContact, "SendLater", "count", 0))
sendLater->addContact(hContact);
HANDLE hDbEvent = db_event_firstUnread(hContact);
@@ -650,7 +650,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_MESSAGE) {
- if (M->FindWindow(hContact) != NULL)
+ if (M.FindWindow(hContact) != NULL)
continue;
cle.hContact = hContact;
@@ -675,10 +675,10 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) HANDLE hContact = c->getContact();
bool fGlobal = PluginConfig.m_LogStatusChanges ? true : false;
- DWORD dwMask = M->GetDword(hContact, SRMSGMOD_T, "mwmask", 0);
- DWORD dwFlags = M->GetDword(hContact, SRMSGMOD_T, "mwflags", 0);
+ DWORD dwMask = db_get_dw(hContact, SRMSGMOD_T, "mwmask", 0);
+ DWORD dwFlags = db_get_dw(hContact, SRMSGMOD_T, "mwflags", 0);
- BYTE fLocal = M->GetByte(hContact, "logstatuschanges", 0);
+ BYTE fLocal = M.GetByte(hContact, "logstatuschanges", 0);
if (fGlobal || fLocal) {
/*
|