summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 22:03:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 22:03:50 +0300
commitb5f2f8c72db1b2eb876169b80083553491abb51d (patch)
treec8d0add08874f2cd7f2d632c97a96c1c4d5b9784 /plugins
parenta09964f1a55a46297e92349cdb3211d3e8e68823 (diff)
tabSRMM -> g_plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp4
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp4
-rw-r--r--plugins/TabSRMM/src/controls.cpp2
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp10
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TabSRMM/src/mim.cpp12
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp8
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp8
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp58
9 files changed, 55 insertions, 55 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index d779f15afe..ffa20a603a 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -141,7 +141,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM)
void CTabBaseDlg::BB_InitDlgButtons()
{
- BYTE gap = DPISCALEX_S(db_get_b(0, SRMSGMOD, "ButtonsBarGap", 1));
+ BYTE gap = DPISCALEX_S(g_plugin.getByte("ButtonsBarGap", 1));
RECT rcSplitter;
GetWindowRect(GetDlgItem(m_hwnd, IDC_SPLITTERY), &rcSplitter);
@@ -203,7 +203,7 @@ BOOL CTabBaseDlg::BB_SetButtonsPos()
if (!m_hwnd || !IsWindowVisible(m_hwnd))
return 0;
- BYTE gap = DPISCALEX_S(db_get_b(0, SRMSGMOD, "ButtonsBarGap", 1));
+ BYTE gap = DPISCALEX_S(g_plugin.getByte("ButtonsBarGap", 1));
bool showToolbar = !(m_pContainer->dwFlags & CNT_HIDETOOLBAR);
bool bBottomToolbar = (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR) != 0;
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp
index 1ed2f289f7..060bbdfe01 100644
--- a/plugins/TabSRMM/src/chat_window.cpp
+++ b/plugins/TabSRMM/src/chat_window.cpp
@@ -2161,13 +2161,13 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
// Typing support for GCW_PRIVMESS sessions
if (m_si->iType == GCW_PRIVMESS) {
if (m_hContact) {
- int iCurrentTypingMode = db_get_b(m_hContact, SRMSGMOD, SRMSGSET_TYPING, db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
+ int iCurrentTypingMode = g_plugin.getByte(m_hContact, SRMSGSET_TYPING, g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON && iCurrentTypingMode) {
DM_NotifyTyping(PROTOTYPE_SELFTYPING_OFF);
m_nTypeMode = PROTOTYPE_SELFTYPING_OFF;
}
- db_set_b(m_hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode);
+ g_plugin.setByte(m_hContact, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode);
}
}
break;
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index d1f3c1b187..247581149f 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -963,7 +963,7 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && (!dat->isChat() || dat->m_si->iType == GCW_PRIVMESS)) {
- int mtnStatus = db_get_b(dat->m_hContact, SRMSGMOD, SRMSGSET_TYPING, db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
+ int mtnStatus = g_plugin.getByte(dat->m_hContact, SRMSGSET_TYPING, g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
mir_snwprintf(wBuf, TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index ab55da5749..d1a9d33596 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -500,13 +500,13 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar
case IDC_SELFTYPING:
if (m_hContact) {
- int iCurrentTypingMode = db_get_b(m_hContact, SRMSGMOD, SRMSGSET_TYPING, db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
+ int iCurrentTypingMode = g_plugin.getByte(m_hContact, SRMSGSET_TYPING, g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON && iCurrentTypingMode) {
DM_NotifyTyping(PROTOTYPE_SELFTYPING_OFF);
m_nTypeMode = PROTOTYPE_SELFTYPING_OFF;
}
- db_set_b(m_hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode);
+ g_plugin.setByte(m_hContact, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode);
}
break;
@@ -903,7 +903,7 @@ void CTabBaseDlg::DM_NotifyTyping(int mode)
return;
// allow supression of sending out TN for the contact (NOTE: for metacontacts, do NOT use the subcontact handle)
- if (!db_get_b(hContact, SRMSGMOD, SRMSGSET_TYPING, db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)))
+ if (!g_plugin.getByte(hContact, SRMSGSET_TYPING, g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)))
return;
if (szProto == nullptr) // should not, but who knows...
@@ -929,7 +929,7 @@ void CTabBaseDlg::DM_NotifyTyping(int mode)
// don't send to contacts which are not permanently added to the contact list,
// unless the option to ignore added status is set.
- if (db_get_b(m_hContact, "CList", "NotOnList", 0) && !db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
+ if (db_get_b(m_hContact, "CList", "NotOnList", 0) && !g_plugin.getByte(SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
return;
// End user check
@@ -1329,7 +1329,7 @@ void CTabBaseDlg::DrawStatusIcons(HDC hDC, const RECT &rc, int gap)
if (!isChat() || m_si->iType == GCW_PRIVMESS) {
DrawIconEx(hDC, x, y, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, 0, nullptr, DI_NORMAL);
- DrawIconEx(hDC, x, y, db_get_b(m_hContact, SRMSGMOD, SRMSGSET_TYPING, db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)) ?
+ DrawIconEx(hDC, x, y, g_plugin.getByte(m_hContact, SRMSGSET_TYPING, g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)) ?
PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, 0, nullptr, DI_NORMAL);
}
else CSkin::DrawDimmedIcon(hDC, x, y, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], 50);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index fea9413e26..244829749d 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -146,7 +146,7 @@ void CGlobals::reloadSettings(bool fReloadSkins)
m_bLogStatusChanges = M.GetBool("logstatuschanges", false);
m_bUseDividers = M.GetBool("usedividers", false);
m_bDividersUsePopupConfig = M.GetBool("div_popupconfig", false);
- m_MsgTimeout = db_get_dw(0, SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
+ m_MsgTimeout = g_plugin.getDword(SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
if (m_MsgTimeout < SRMSGSET_MSGTIMEOUT_MIN)
m_MsgTimeout = SRMSGSET_MSGTIMEOUT_MIN;
@@ -169,7 +169,7 @@ void CGlobals::reloadSettings(bool fReloadSkins)
m_LangPackCP = Langpack_GetDefaultCodePage();
m_visualMessageSizeIndicator = M.GetByte("msgsizebar", 0);
m_autoSplit = M.GetByte("autosplit", 0);
- m_FlashOnMTN = db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
+ m_FlashOnMTN = g_plugin.getByte(SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
if (m_MenuBar == nullptr) {
m_MenuBar = ::LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 69246d827e..612f5463bb 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -214,7 +214,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
hContact = hMeta;
}
- if (hwnd && db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
+ if (hwnd && g_plugin.getByte(SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
preTyping = SendMessage(hwnd, DM_TYPING, 0, mode);
if (hwnd && IsWindowVisible(hwnd))
@@ -229,10 +229,10 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
return 0;
}
- if (db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
- if (!hwnd && !db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
+ if (g_plugin.getByte(SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
+ if (!hwnd && !g_plugin.getByte(SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
fShowOnClist = false;
- if (hwnd && !db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1))
+ if (hwnd && !g_plugin.getByte(SRMSGSET_SHOWTYPINGWINOPEN, 1))
fShowOnClist = false;
}
else fShowOnClist = false;
@@ -240,7 +240,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
if ((!foundWin || !(pContainer->dwFlags & CNT_NOSOUND)) && preTyping != (mode != 0))
Skin_PlaySound(mode ? "TNStart" : "TNStop");
- if (db_get_b(0, SRMSGMOD, "ShowTypingPopup", 0)) {
+ if (g_plugin.getByte("ShowTypingPopup", 0)) {
BOOL fShow = false;
int iMode = M.GetByte("MTN_PopupMode", 0);
@@ -272,7 +272,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
if (mode) {
wchar_t szTip[256];
mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
- if (fShowOnClist && db_get_b(0, SRMSGMOD, "ShowTypingBalloon", 0))
+ if (fShowOnClist && g_plugin.getByte("ShowTypingBalloon", 0))
Clist_TrayNotifyW(nullptr, TranslateT("Typing notification"), szTip, NIIF_INFO, 1000 * 4);
if (fShowOnClist) {
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 823515e596..f1d24561ec 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -662,7 +662,7 @@ bool CSrmmWindow::OnInitDialog()
GetMyNick();
- m_iMultiSplit = db_get_dw(0, SRMSGMOD, "multisplit", 150);
+ m_iMultiSplit = g_plugin.getDword("multisplit", 150);
m_nTypeMode = PROTOTYPE_SELFTYPING_OFF;
SetTimer(m_hwnd, TIMERID_TYPE, 1000, nullptr);
m_iLastEventType = 0xffffffff;
@@ -773,7 +773,7 @@ bool CSrmmWindow::OnInitDialog()
// restore saved msg if any...
if (m_hContact) {
- ptrW tszSavedMsg(db_get_wsa(m_hContact, SRMSGMOD, "SavedMsg"));
+ ptrW tszSavedMsg(g_plugin.getWStringA(m_hContact, "SavedMsg"));
if (tszSavedMsg != 0) {
SETTEXTEX stx = { ST_DEFAULT, 1200 };
m_message.SendMsg(EM_SETTEXTEX, (WPARAM)&stx, tszSavedMsg);
@@ -883,7 +883,7 @@ void CSrmmWindow::OnDestroy()
db_set_utf(m_hContact, SRMSGMOD, "SavedMsg", msg);
mir_free(msg);
}
- else db_unset(m_hContact, SRMSGMOD, "SavedMsg");
+ else g_plugin.delSetting(m_hContact, "SavedMsg");
}
else SendMessage(m_hwnd, WM_COMMAND, IDC_PIC, 0);
}
@@ -921,7 +921,7 @@ void CSrmmWindow::OnDestroy()
DeleteMenu(PluginConfig.g_hMenuTrayUnread, m_hContact, MF_BYCOMMAND);
if (m_cache->isValid())
- db_set_dw(0, SRMSGMOD, "multisplit", m_iMultiSplit);
+ g_plugin.setDword("multisplit", m_iMultiSplit);
int i = GetTabIndexFromHWND(m_hwndParent, m_hwnd);
if (i >= 0) {
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index b30e050518..6e29283dfc 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1114,9 +1114,9 @@ void CTabBaseDlg::SetMessageLog()
void CTabBaseDlg::FindFirstEvent()
{
- int historyMode = db_get_b(m_hContact, SRMSGMOD, SRMSGSET_LOADHISTORY, -1);
+ int historyMode = g_plugin.getByte(m_hContact, SRMSGSET_LOADHISTORY, -1);
if (historyMode == -1)
- historyMode = (int)db_get_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY);
+ historyMode = (int)g_plugin.getByte(SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY);
m_hDbEventFirst = db_event_firstUnread(m_hContact);
@@ -1133,7 +1133,7 @@ void CTabBaseDlg::FindFirstEvent()
if (m_bActualHistory)
i = m_cache->getSessionMsgCount();
else
- i = db_get_w(0, SRMSGMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT);
+ i = g_plugin.getWord(SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT);
for (; i > 0; i--) {
if (m_hDbEventFirst == 0)
@@ -1158,7 +1158,7 @@ void CTabBaseDlg::FindFirstEvent()
else
db_event_get(m_hDbEventFirst, &dbei);
- DWORD firstTime = dbei.timestamp - 60 * db_get_w(0, SRMSGMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
+ DWORD firstTime = dbei.timestamp - 60 * g_plugin.getWord(SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
for (;;) {
if (m_hDbEventFirst == 0)
hPrevEvent = db_event_last(m_hContact);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 2170dc0884..0c2431ec1e 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -688,7 +688,7 @@ public:
{
DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
- switch (db_get_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
+ switch (g_plugin.getByte(SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
case LOADHISTORY_UNREAD:
chkLoadUnread.SetState(true);
break;
@@ -714,10 +714,10 @@ public:
spnRight.SetPosition(M.GetDword("RightIndent", 20));
spnLoadCount.SetRange(100);
- spnLoadCount.SetPosition(db_get_w(0, SRMSGMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT));
+ spnLoadCount.SetPosition(g_plugin.getWord(SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT));
spnLoadTime.SetRange(24 * 60);
- spnLoadTime.SetPosition(db_get_w(0, SRMSGMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME));
+ spnLoadTime.SetPosition(g_plugin.getWord(SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME));
DWORD maxhist = M.GetDword("maxhist", 0);
spnTrim.SetRange(1000, 5);
@@ -757,13 +757,13 @@ public:
dwFlags &= ~(MWF_LOG_ALL);
if (chkLoadCount.GetState())
- db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
+ g_plugin.setByte(SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
else if (chkLoadTime.GetState())
- db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
+ g_plugin.setByte(SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
- db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- db_set_w(0, SRMSGMOD, SRMSGSET_LOADCOUNT, spnLoadCount.GetPosition());
- db_set_w(0, SRMSGMOD, SRMSGSET_LOADTIME, spnLoadTime.GetPosition());
+ g_plugin.setByte(SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
+ g_plugin.setWord(SRMSGSET_LOADCOUNT, spnLoadCount.GetPosition());
+ g_plugin.setWord(SRMSGSET_LOADTIME, spnLoadTime.GetPosition());
db_set_dw(0, SRMSGMOD_T, "IndentAmount", spnLeft.GetPosition());
db_set_dw(0, SRMSGMOD_T, "RightIndent", spnRight.GetPosition());
@@ -868,16 +868,16 @@ class COptTypingDlg : public CDlgBase
void RebuildList()
{
- BYTE defType = db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW);
+ BYTE defType = g_plugin.getByte(SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW);
if (hItemNew && defType)
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemNew, 1);
- if (hItemUnknown && db_get_b(0, SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
+ if (hItemUnknown && g_plugin.getByte(SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1);
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
- if (hItem && db_get_b(hContact, SRMSGMOD, SRMSGSET_TYPING, defType))
+ if (hItem && g_plugin.getByte(hContact, SRMSGSET_TYPING, defType))
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
}
@@ -885,15 +885,15 @@ class COptTypingDlg : public CDlgBase
void SaveList()
{
if (hItemNew)
- db_set_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 1 : 0));
+ g_plugin.setByte(SRMSGSET_TYPINGNEW, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 1 : 0));
if (hItemUnknown)
- db_set_b(0, SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0));
+ g_plugin.setByte(SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0));
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem)
- db_set_b(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
+ g_plugin.setByte(hContact, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
}
}
@@ -926,15 +926,15 @@ public:
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE) | (CLS_SHOWHIDDEN));
ResetCList();
- CheckDlgButton(m_hwnd, IDC_SHOWNOTIFY, db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_TYPEFLASHWIN, db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SHOWNOTIFY, g_plugin.getByte(SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_TYPEFLASHWIN, g_plugin.getByte(SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_TYPENOWIN, db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_TYPEWIN, db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_NOTIFYTRAY, db_get_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_NOTIFYBALLOON, db_get_b(0, SRMSGMOD, "ShowTypingBalloon", 0));
+ CheckDlgButton(m_hwnd, IDC_TYPENOWIN, g_plugin.getByte(SRMSGSET_SHOWTYPINGNOWINOPEN, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_TYPEWIN, g_plugin.getByte(SRMSGSET_SHOWTYPINGWINOPEN, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_NOTIFYTRAY, g_plugin.getByte(SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_NOTIFYBALLOON, g_plugin.getByte("ShowTypingBalloon", 0));
- CheckDlgButton(m_hwnd, IDC_NOTIFYPOPUP, db_get_b(0, SRMSGMOD, "ShowTypingPopup", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_NOTIFYPOPUP, g_plugin.getByte("ShowTypingPopup", 0) ? BST_CHECKED : BST_UNCHECKED);
Utils::enableDlgControl(m_hwnd, IDC_TYPEWIN, IsDlgButtonChecked(m_hwnd, IDC_NOTIFYTRAY) != 0);
Utils::enableDlgControl(m_hwnd, IDC_TYPENOWIN, IsDlgButtonChecked(m_hwnd, IDC_NOTIFYTRAY) != 0);
@@ -961,13 +961,13 @@ public:
bool OnApply() override
{
SaveList();
- db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWNOTIFY));
- db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPEFLASHWIN));
- db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPENOWIN));
- db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPEWIN));
- db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYTRAY));
- db_set_b(0, SRMSGMOD, "ShowTypingBalloon", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYBALLOON));
- db_set_b(0, SRMSGMOD, "ShowTypingPopup", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYPOPUP));
+ g_plugin.setByte(SRMSGSET_SHOWTYPING, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWNOTIFY));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGWINFLASH, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPEFLASHWIN));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPENOWIN));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGWINOPEN, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TYPEWIN));
+ g_plugin.setByte(SRMSGSET_SHOWTYPINGCLIST, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYTRAY));
+ g_plugin.setByte("ShowTypingBalloon", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYBALLOON));
+ g_plugin.setByte("ShowTypingPopup", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYPOPUP));
db_set_b(0, SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(m_hwnd, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
PluginConfig.reloadSettings();
return true;
@@ -1232,7 +1232,7 @@ public:
int msgTimeout = 1000 * spnTimeout.GetPosition();
PluginConfig.m_MsgTimeout = msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout : SRMSGSET_MSGTIMEOUT_MIN;
- db_set_dw(0, SRMSGMOD, SRMSGSET_MSGTIMEOUT, PluginConfig.m_MsgTimeout);
+ g_plugin.setDword(SRMSGSET_MSGTIMEOUT, PluginConfig.m_MsgTimeout);
db_set_b(0, SRMSGMOD_T, "historysize", spnHistSize.GetPosition());
PluginConfig.reloadAdv();