summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-19 21:40:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-19 21:40:51 +0000
commitf4fac2038f723df23d1771e8632ad3d74357f8e5 (patch)
tree1216113e31072a4556c492b0978825826ee18925 /src
parent6b4cfc3055b541413333c8af4a3b141027a4daa9 (diff)
- chat log background color setting merged with kernel chats;
- constants for chat modules git-svn-id: http://svn.miranda-ng.org/main/trunk@7780 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/stdchat/src/main.cpp32
-rw-r--r--src/core/stdchat/src/options.cpp116
-rw-r--r--src/core/stdchat/src/tools.cpp2
-rw-r--r--src/core/stdchat/src/window.cpp52
-rw-r--r--src/modules/chat/chat_opts.cpp82
-rw-r--r--src/modules/chat/chat_svc.cpp14
-rw-r--r--src/modules/chat/clist.cpp4
-rw-r--r--src/modules/chat/tools.cpp2
8 files changed, 152 insertions, 152 deletions
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp
index 0e5f6758a2..63688d51cf 100644
--- a/src/core/stdchat/src/main.cpp
+++ b/src/core/stdchat/src/main.cpp
@@ -256,21 +256,21 @@ static BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
static void OnLoadSettings()
{
- g_Settings.iX = db_get_dw(NULL, "Chat", "roomx", -1);
- g_Settings.iY = db_get_dw(NULL, "Chat", "roomy", -1);
+ g_Settings.iX = db_get_dw(NULL, CHAT_MODULE, "roomx", -1);
+ g_Settings.iY = db_get_dw(NULL, CHAT_MODULE, "roomy", -1);
- g_Settings.bTabsEnable = db_get_b(NULL, "Chat", "Tabs", 1) != 0;
- g_Settings.TabRestore = db_get_b(NULL, "Chat", "TabRestore", 0) != 0;
- g_Settings.TabsAtBottom = db_get_b(NULL, "Chat", "TabBottom", 0) != 0;
- g_Settings.TabCloseOnDblClick = db_get_b(NULL, "Chat", "TabCloseOnDblClick", 0) != 0;
+ g_Settings.bTabsEnable = db_get_b(NULL, CHAT_MODULE, "Tabs", 1) != 0;
+ g_Settings.TabRestore = db_get_b(NULL, CHAT_MODULE, "TabRestore", 0) != 0;
+ g_Settings.TabsAtBottom = db_get_b(NULL, CHAT_MODULE, "TabBottom", 0) != 0;
+ g_Settings.TabCloseOnDblClick = db_get_b(NULL, CHAT_MODULE, "TabCloseOnDblClick", 0) != 0;
ZeroMemory(&g_TabSession, sizeof(SESSION_INFO));
g_TabSession.iType = GCW_TABROOM;
g_TabSession.iSplitterX = g_Settings.iSplitterX;
g_TabSession.iSplitterY = g_Settings.iSplitterY;
- g_TabSession.iLogFilterFlags = (int)db_get_dw(NULL, "Chat", "FilterFlags", 0x03E0);
- g_TabSession.bFilterEnabled = db_get_b(NULL, "Chat", "FilterEnabled", 0);
- g_TabSession.bNicklistEnabled = db_get_b(NULL, "Chat", "ShowNicklist", 1);
+ g_TabSession.iLogFilterFlags = (int)db_get_dw(NULL, CHAT_MODULE, "FilterFlags", 0x03E0);
+ g_TabSession.bFilterEnabled = db_get_b(NULL, CHAT_MODULE, "FilterEnabled", 0);
+ g_TabSession.bNicklistEnabled = db_get_b(NULL, CHAT_MODULE, "ShowNicklist", 1);
g_TabSession.iFG = 4;
g_TabSession.bFGSet = TRUE;
g_TabSession.iBG = 2;
@@ -280,7 +280,7 @@ static void OnLoadSettings()
static void RegisterFonts()
{
ColourIDT colourid = { sizeof(colourid) };
- strncpy(colourid.dbSettingsGroup, "Chat", sizeof(colourid.dbSettingsGroup));
+ strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
_tcsncpy(colourid.group, LPGENT("Chat module"), SIZEOF(colourid.group));
strncpy(colourid.setting, "ColorLogBG", SIZEOF(colourid.setting));
@@ -359,12 +359,12 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
- db_set_w(NULL, "Chat", "SplitterY", (WORD)g_Settings.iSplitterY);
- db_set_dw(NULL, "Chat", "roomx", g_Settings.iX);
- db_set_dw(NULL, "Chat", "roomy", g_Settings.iY);
- db_set_dw(NULL, "Chat", "roomwidth" , g_Settings.iWidth);
- db_set_dw(NULL, "Chat", "roomheight", g_Settings.iHeight);
+ db_set_w(NULL, CHAT_MODULE, "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, CHAT_MODULE, "SplitterY", (WORD)g_Settings.iSplitterY);
+ db_set_dw(NULL, CHAT_MODULE, "roomx", g_Settings.iX);
+ db_set_dw(NULL, CHAT_MODULE, "roomy", g_Settings.iY);
+ db_set_dw(NULL, CHAT_MODULE, "roomwidth" , g_Settings.iWidth);
+ db_set_dw(NULL, CHAT_MODULE, "roomheight", g_Settings.iHeight);
DestroyMenu(g_hMenu);
return 0;
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index 5fefef89ad..e021db88c0 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -164,9 +164,9 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, const struct branch_t *
tvis.item.pszText = TranslateTS(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
- iState = ((db_get_dw(NULL, "Chat", branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode) != 0 ? 2 : 1;
+ iState = ((db_get_dw(NULL, CHAT_MODULE, branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode) != 0 ? 2 : 1;
else
- iState = db_get_b(NULL, "Chat", branch[i].szDBName, branch[i].bDefault) != 0 ? 2 : 1;
+ iState = db_get_b(NULL, CHAT_MODULE, branch[i].szDBName, branch[i].bDefault) != 0 ? 2 : 1;
tvis.item.state = INDEXTOSTATEIMAGEMASK(iState);
hItemB[i] = TreeView_InsertItem(hwndTree, &tvis);
}
@@ -187,9 +187,9 @@ static void SaveBranch(HWND hwndTree, const struct branch_t *branch, HTREEITEM *
iState |= branch[i].iMode;
if (iState & GC_EVENT_ADDSTATUS)
iState |= GC_EVENT_REMOVESTATUS;
- db_set_dw(NULL, "Chat", branch[i].szDBName, (DWORD)iState);
+ db_set_dw(NULL, CHAT_MODULE, branch[i].szDBName, (DWORD)iState);
}
- else db_set_b(NULL, "Chat", branch[i].szDBName, bChecked);
+ else db_set_b(NULL, CHAT_MODULE, branch[i].szDBName, bChecked);
} }
static void CheckHeading(HWND hwndTree, HTREEITEM hHeading)
@@ -315,7 +315,7 @@ HICON LoadIconEx(char* pszIcoLibName, BOOL big)
static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, "Chat", pszSetting, &dbv)) {
+ if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrT(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
@@ -335,14 +335,14 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHECKBOXES),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHECKBOXES),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- hListHeading0 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Options for using a tabbed interface"), db_get_b(NULL, "Chat", "Branch0Exp", 0)?TRUE:FALSE);
- hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Appearance and functionality of chat room windows"), db_get_b(NULL, "Chat", "Branch1Exp", 0)?TRUE:FALSE);
- hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Appearance of the message log"), db_get_b(NULL, "Chat", "Branch2Exp", 0)?TRUE:FALSE);
- hListHeading3 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Default events to show in new chat rooms if the \'event filter\' is enabled"), db_get_b(NULL, "Chat", "Branch3Exp", 0)?TRUE:FALSE);
- hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Icons to display in the message log"), db_get_b(NULL, "Chat", "Branch4Exp", 0)?TRUE:FALSE);
- hListHeading5 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Icons to display in the tray"), db_get_b(NULL, "Chat", "Branch5Exp", 0)?TRUE:FALSE);
+ hListHeading0 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Options for using a tabbed interface"), db_get_b(NULL, CHAT_MODULE, "Branch0Exp", 0)?TRUE:FALSE);
+ hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Appearance and functionality of chat room windows"), db_get_b(NULL, CHAT_MODULE, "Branch1Exp", 0)?TRUE:FALSE);
+ hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Appearance of the message log"), db_get_b(NULL, CHAT_MODULE, "Branch2Exp", 0)?TRUE:FALSE);
+ hListHeading3 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Default events to show in new chat rooms if the \'event filter\' is enabled"), db_get_b(NULL, CHAT_MODULE, "Branch3Exp", 0)?TRUE:FALSE);
+ hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Icons to display in the message log"), db_get_b(NULL, CHAT_MODULE, "Branch4Exp", 0)?TRUE:FALSE);
+ hListHeading5 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Icons to display in the tray"), db_get_b(NULL, CHAT_MODULE, "Branch5Exp", 0)?TRUE:FALSE);
if (PopupInstalled)
- hListHeading6 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Popups to display"), db_get_b(NULL, "Chat", "Branch6Exp", 0)?TRUE:FALSE);
+ hListHeading6 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), LPGEN("Popups to display"), db_get_b(NULL, CHAT_MODULE, "Branch6Exp", 0)?TRUE:FALSE);
FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading0, branch0, hItemB0, SIZEOF(branch0), 0);
FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, branch1, hItemB1, SIZEOF(branch1), 0);
FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, branch2, hItemB2, SIZEOF(branch2), 0);
@@ -411,7 +411,7 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- BYTE b = db_get_b(NULL, "Chat", "Tabs", 1);
+ BYTE b = db_get_b(NULL, CHAT_MODULE, "Tabs", 1);
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch0, hItemB0, SIZEOF(branch0));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, hItemB1, SIZEOF(branch1));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, hItemB2, SIZEOF(branch2));
@@ -420,17 +420,17 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch5, hItemB5, SIZEOF(branch5));
if (PopupInstalled)
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch6, hItemB6, SIZEOF(branch6));
- g_Settings.dwIconFlags = db_get_dw(NULL, "Chat", "IconFlags", 0x0000);
- g_Settings.dwTrayIconFlags = db_get_dw(NULL, "Chat", "TrayIconFlags", 0x1000);
- g_Settings.dwPopupFlags = db_get_dw(NULL, "Chat", "PopupFlags", 0x0000);
- g_Settings.bStripFormat = db_get_b(NULL, "Chat", "TrimFormatting", 0) != 0;
- g_Settings.bTrayIconInactiveOnly = db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1) != 0;
- g_Settings.bPopupInactiveOnly = db_get_b(NULL, "Chat", "PopupInactiveOnly", 1) != 0;
- g_Settings.bLogIndentEnabled = db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0;
-
- if (b != db_get_b(NULL, "Chat", "Tabs", 1)) {
+ g_Settings.dwIconFlags = db_get_dw(NULL, CHAT_MODULE, "IconFlags", 0x0000);
+ g_Settings.dwTrayIconFlags = db_get_dw(NULL, CHAT_MODULE, "TrayIconFlags", 0x1000);
+ g_Settings.dwPopupFlags = db_get_dw(NULL, CHAT_MODULE, "PopupFlags", 0x0000);
+ g_Settings.bStripFormat = db_get_b(NULL, CHAT_MODULE, "TrimFormatting", 0) != 0;
+ g_Settings.bTrayIconInactiveOnly = db_get_b(NULL, CHAT_MODULE, "TrayIconInactiveOnly", 1) != 0;
+ g_Settings.bPopupInactiveOnly = db_get_b(NULL, CHAT_MODULE, "PopupInactiveOnly", 1) != 0;
+ g_Settings.bLogIndentEnabled = db_get_b(NULL, CHAT_MODULE, "LogIndentEnabled", 1) != 0;
+
+ if (b != db_get_b(NULL, CHAT_MODULE, "Tabs", 1)) {
pci->SM_BroadcastMessage(NULL, GC_CLOSEWINDOW, 0, 1, FALSE);
- g_Settings.bTabsEnable = db_get_b(NULL, "Chat", "Tabs", 1) != 0;
+ g_Settings.bTabsEnable = db_get_b(NULL, CHAT_MODULE, "Tabs", 1) != 0;
}
else pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
@@ -441,20 +441,20 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
case WM_DESTROY:
BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch1Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch1Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch2Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch2Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading3, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch3Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch3Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading4, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch4Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch4Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading5, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch5Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch5Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading0, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch0Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch0Exp", b);
if (PopupInstalled) {
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading6, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
- db_set_b(NULL, "Chat", "Branch6Exp", b);
+ db_set_b(NULL, CHAT_MODULE, "Branch6Exp", b);
}
break;
}
@@ -470,11 +470,11 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_SPIN2, UDM_SETRANGE, 0, MAKELONG(5000, 0));
- SendDlgItemMessage(hwndDlg, IDC_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "Chat", "LogLimit", 100), 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LogLimit", 100), 0));
SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_SETRANGE, 0, MAKELONG(10000, 0));
- SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "Chat", "LoggingLimit", 100), 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100), 0));
SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETRANGE, 0, MAKELONG(255, 10));
- SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, "Chat", "NicklistRowDist", 12), 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12), 0));
{
TCHAR* pszGroup = NULL;
InitSetting(&pszGroup, "AddToGroup", _T("Chat rooms"));
@@ -566,78 +566,78 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
*p2 = ' ';
p2 = _tcschr(ptszText, ',');
}
- db_set_ts(NULL, "Chat", "HighlightWords", ptszText);
+ db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
}
}
- else db_unset(NULL, "Chat", "HighlightWords");
+ else db_unset(NULL, CHAT_MODULE, "HighlightWords");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText, iLen + 1);
- db_set_ts(NULL, "Chat", "LogDirectory", pszText);
+ db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText);
}
- else db_unset(NULL, "Chat", "LogDirectory");
+ else db_unset(NULL, CHAT_MODULE, "LogDirectory");
pci->SM_InvalidateLogDirectories();
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP));
if (iLen > 0) {
pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
- db_set_ts(NULL, "Chat", "LogTimestamp", pszText);
+ db_set_ts(NULL, CHAT_MODULE, "LogTimestamp", pszText);
}
- else db_unset(NULL, "Chat", "LogTimestamp");
+ else db_unset(NULL, CHAT_MODULE, "LogTimestamp");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
- db_set_ts(NULL, "Chat", "HeaderTime", pszText);
+ db_set_ts(NULL, CHAT_MODULE, "HeaderTime", pszText);
}
- else db_unset(NULL, "Chat", "HeaderTime");
+ else db_unset(NULL, CHAT_MODULE, "HeaderTime");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
- db_set_ts(NULL, "Chat", "HeaderIncoming", pszText);
+ db_set_ts(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
}
- else db_unset(NULL, "Chat", "HeaderIncoming");
+ else db_unset(NULL, CHAT_MODULE, "HeaderIncoming");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
- db_set_ts(NULL, "Chat", "HeaderOutgoing", pszText);
+ db_set_ts(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
}
- else db_unset(NULL, "Chat", "HeaderOutgoing");
+ else db_unset(NULL, CHAT_MODULE, "HeaderOutgoing");
g_Settings.bHighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHT) == BST_CHECKED;
- db_set_b(NULL, "Chat", "HighlightEnabled", g_Settings.bHighlightEnabled);
+ db_set_b(NULL, CHAT_MODULE, "HighlightEnabled", g_Settings.bHighlightEnabled);
g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_LOGGING) == BST_CHECKED;
- db_set_b(NULL, "Chat", "LoggingEnabled", g_Settings.bLoggingEnabled);
+ db_set_b(NULL, CHAT_MODULE, "LoggingEnabled", g_Settings.bLoggingEnabled);
iLen = SendDlgItemMessage(hwndDlg, IDC_SPIN2, UDM_GETPOS, 0, 0);
- db_set_w(NULL, "Chat", "LogLimit", (WORD)iLen);
+ db_set_w(NULL, CHAT_MODULE, "LogLimit", (WORD)iLen);
iLen = SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_GETPOS, 0, 0);
- db_set_w(NULL, "Chat", "LoggingLimit", (WORD)iLen);
+ db_set_w(NULL, CHAT_MODULE, "LoggingLimit", (WORD)iLen);
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP));
if (iLen > 0) {
pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
- db_set_ts(NULL, "Chat", "AddToGroup", pszText);
+ db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
- else db_set_s(NULL, "Chat", "AddToGroup", "");
+ else db_set_s(NULL, CHAT_MODULE, "AddToGroup", "");
mir_free(pszText);
iLen = SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_GETPOS, 0, 0);
if (iLen > 0)
- db_set_b(NULL, "Chat", "NicklistRowDist", (BYTE)iLen);
+ db_set_b(NULL, CHAT_MODULE, "NicklistRowDist", (BYTE)iLen);
else
- db_unset(NULL, "Chat", "NicklistRowDist");
+ db_unset(NULL, CHAT_MODULE, "NicklistRowDist");
pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
return TRUE;
@@ -703,16 +703,16 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg, UINT uMsg, WPARAM wPar
iLen = 1;
g_Settings.iPopupStyle = iLen;
- db_set_b(NULL, "Chat", "PopupStyle", (BYTE)iLen);
+ db_set_b(NULL, CHAT_MODULE, "PopupStyle", (BYTE)iLen);
iLen = SendDlgItemMessage(hwndDlg, IDC_SPIN1, UDM_GETPOS, 0, 0);
g_Settings.iPopupTimeout = iLen;
- db_set_w(NULL, "Chat", "PopupTimeout", (WORD)iLen);
+ db_set_w(NULL, CHAT_MODULE, "PopupTimeout", (WORD)iLen);
g_Settings.crPUBkgColour = SendDlgItemMessage(hwndDlg, IDC_BKG, CPM_GETCOLOUR, 0, 0);
- db_set_dw(NULL, "Chat", "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg, IDC_BKG, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(NULL, CHAT_MODULE, "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg, IDC_BKG, CPM_GETCOLOUR, 0, 0));
g_Settings.crPUTextColour = SendDlgItemMessage(hwndDlg, IDC_TEXT, CPM_GETCOLOUR, 0, 0);
- db_set_dw(NULL, "Chat", "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TEXT, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(NULL, CHAT_MODULE, "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TEXT, CPM_GETCOLOUR, 0, 0));
return TRUE;
}
break;
@@ -742,7 +742,7 @@ int OptionsInitialize(WPARAM wParam, LPARAM lParam)
if (PopupInstalled) {
odp.position = 910000002;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPOPUP);
- odp.pszTitle = LPGEN("Chat");
+ odp.pszTitle = LPGEN(CHAT_MODULE);
odp.pszGroup = LPGEN("Popups");
odp.pszTab = NULL;
odp.pfnDlgProc = DlgProcOptionsPopup;
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp
index 3b29352143..ab82184a58 100644
--- a/src/core/stdchat/src/tools.cpp
+++ b/src/core/stdchat/src/tools.cpp
@@ -54,7 +54,7 @@ void CheckColorsInModule(const char* pszModule)
{
MODULEINFO *pMod = pci->MM_FindModule(pszModule);
int i = 0;
- COLORREF crBG = (COLORREF)db_get_dw(NULL, "Chat", "ColorMessageBG", GetSysColor(COLOR_WINDOW));
+ COLORREF crBG = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
COLORREF crFG;
pci->LoadMsgDlgFont(17, NULL, &crFG);
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp
index b720302bbc..f4dae08481 100644
--- a/src/core/stdchat/src/window.cpp
+++ b/src/core/stdchat/src/window.cpp
@@ -123,10 +123,10 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc)
{
SESSION_INFO *si = (SESSION_INFO*)lParam;
- BOOL bControl = (BOOL)db_get_b(NULL, "Chat", "ShowTopButtons", 1);
- BOOL bFormat = (BOOL)db_get_b(NULL, "Chat", "ShowFormatButtons", 1);
+ BOOL bControl = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowTopButtons", 1);
+ BOOL bFormat = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowFormatButtons", 1);
BOOL bToolbar = bFormat || bControl;
- BOOL bSend = (BOOL)db_get_b(NULL, "Chat", "ShowSend", 0);
+ BOOL bSend = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowSend", 0);
BOOL bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
BOOL bTabs = g_Settings.bTabsEnable;
BOOL bTabBottom = g_Settings.TabsAtBottom;
@@ -291,11 +291,11 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
return TRUE;
if (wParam == '\n' || wParam == '\r') {
- if ((isCtrl != 0) ^ (0 != db_get_b(NULL, "Chat", "SendOnEnter", 1))) {
+ if ((isCtrl != 0) ^ (0 != db_get_b(NULL, CHAT_MODULE, "SendOnEnter", 1))) {
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
- if (db_get_b(NULL, "Chat", "SendOnDblEnter", 0)) {
+ if (db_get_b(NULL, CHAT_MODULE, "SendOnDblEnter", 0)) {
if (dat->lastEnterTime + 2 < time(NULL))
dat->lastEnterTime = time(NULL);
else {
@@ -324,10 +324,10 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
BOOL isAlt = GetKeyState(VK_MENU) & 0x8000;
if (wParam == VK_RETURN) {
dat->szTabSave[0] = '\0';
- if ((isCtrl != 0) ^ (0 != db_get_b(NULL, "Chat", "SendOnEnter", 1)))
+ if ((isCtrl != 0) ^ (0 != db_get_b(NULL, CHAT_MODULE, "SendOnEnter", 1)))
return 0;
- if (db_get_b(NULL, "Chat", "SendOnDblEnter", 0))
+ if (db_get_b(NULL, CHAT_MODULE, "SendOnDblEnter", 0))
if (dat->lastEnterTime + 2 >= time(NULL))
return 0;
@@ -667,7 +667,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
if (pmi && pmi->bBkgColor) {
int index = GetColorIndex(Parentsi->pszModule, cf.crBackColor);
- COLORREF crB = (COLORREF)db_get_dw(NULL, "Chat", "ColorMessageBG", GetSysColor(COLOR_WINDOW));
+ COLORREF crB = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
UINT u = IsDlgButtonChecked(GetParent(hwnd), IDC_BKGCOLOR);
if (index >= 0) {
@@ -794,7 +794,7 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L
{
switch (msg) {
case WM_RBUTTONUP:
- if (db_get_b(NULL, "Chat", "RightClickFilter", 0) != 0) {
+ if (db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) != 0) {
if (GetDlgItem(GetParent(hwnd), IDC_FILTER) == hwnd)
SendMessage(GetParent(hwnd), GC_SHOWFILTERMENU, 0, 0);
if (GetDlgItem(GetParent(hwnd), IDC_COLOR) == hwnd)
@@ -1239,15 +1239,15 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
cf.dwMask = CFM_COLOR|CFM_BOLD|CFM_UNDERLINE|CFM_BACKCOLOR;
cf.dwEffects = 0;
cf.crTextColor = crFore;
- cf.crBackColor = (COLORREF)db_get_dw(NULL, "Chat", "ColorMessageBG", GetSysColor(COLOR_WINDOW));
- SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETBKGNDCOLOR , 0, db_get_dw(NULL, "Chat", "ColorMessageBG", GetSysColor(COLOR_WINDOW)));
+ cf.crBackColor = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
+ SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETBKGNDCOLOR , 0, db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW)));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM) g_Settings.MessageBoxFont, MAKELPARAM(TRUE, 0));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, (WPARAM)SCF_ALL , (LPARAM)&cf);
// nicklist
int ih = GetTextPixelSize( _T("AQGglo"), g_Settings.UserListFont,FALSE);
int ih2 = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListHeadingsFont, FALSE);
- int height = db_get_b(NULL, "Chat", "NicklistRowDist", 12);
+ int height = db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12);
int font = ih > ih2 ? ih : ih2;
// make sure we have space for icon!
@@ -1315,7 +1315,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
SESSION_INFO* pActive = pci->GetActiveSession();
RECT screen;
- int savePerContact = db_get_b(NULL, "Chat", "SavePosition", 0);
+ int savePerContact = db_get_b(NULL, CHAT_MODULE, "SavePosition", 0);
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
@@ -1332,13 +1332,13 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
break;
}
if (savePerContact) {
- if (RestoreWindowPosition(hwndDlg, g_Settings.bTabsEnable?NULL:si->hContact, "Chat", "room", SW_HIDE))
+ if (RestoreWindowPosition(hwndDlg, g_Settings.bTabsEnable?NULL:si->hContact, CHAT_MODULE, "room", SW_HIDE))
break;
SetWindowPos(hwndDlg, 0, (screen.right-screen.left)/2- (550)/2,(screen.bottom-screen.top)/2- (400)/2, (550), (400), SWP_NOZORDER |SWP_HIDEWINDOW|SWP_NOACTIVATE);
}
else SetWindowPos(hwndDlg, 0, (screen.right-screen.left)/2- (550)/2,(screen.bottom-screen.top)/2- (400)/2, (550), (400), SWP_NOZORDER |SWP_HIDEWINDOW|SWP_NOACTIVATE);
- if (!g_Settings.bTabsEnable && pActive && pActive->hWnd && db_get_b(NULL, "Chat", "CascadeWindows", 1)) {
+ if (!g_Settings.bTabsEnable && pActive && pActive->hWnd && db_get_b(NULL, CHAT_MODULE, "CascadeWindows", 1)) {
RECT rcThis, rcNew;
int dwFlag = SWP_NOZORDER | SWP_NOACTIVATE;
if (!IsWindowVisible((HWND)wParam))
@@ -1749,7 +1749,7 @@ END_REMOVETAB:
int ih = GetTextPixelSize( _T("AQGgl'"), g_Settings.UserListFont,FALSE);
int ih2 = GetTextPixelSize( _T("AQGg'"), g_Settings.UserListHeadingsFont,FALSE);
int font = ih > ih2?ih:ih2;
- int height = db_get_b(NULL, "Chat", "NicklistRowDist", 12);
+ int height = db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12);
// make sure we have space for icon!
if (g_Settings.bShowContactStatus)
@@ -1843,11 +1843,11 @@ END_REMOVETAB:
case SESSION_TERMINATE:
SendMessage(hwndDlg, GC_SAVEWNDPOS, 0, 0);
- if (db_get_b(NULL, "Chat", "SavePosition", 0)) {
- db_set_dw(si->hContact, "Chat", "roomx", si->iX);
- db_set_dw(si->hContact, "Chat", "roomy", si->iY);
- db_set_dw(si->hContact, "Chat", "roomwidth", si->iWidth);
- db_set_dw(si->hContact, "Chat", "roomheight", si->iHeight);
+ if (db_get_b(NULL, CHAT_MODULE, "SavePosition", 0)) {
+ db_set_dw(si->hContact, CHAT_MODULE, "roomx", si->iX);
+ db_set_dw(si->hContact, CHAT_MODULE, "roomy", si->iY);
+ db_set_dw(si->hContact, CHAT_MODULE, "roomwidth", si->iWidth);
+ db_set_dw(si->hContact, CHAT_MODULE, "roomheight", si->iHeight);
}
if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)GC_FAKE_EVENT);
@@ -1865,7 +1865,7 @@ END_REMOVETAB:
goto LABEL_SHOWWINDOW;
case SESSION_INITDONE:
- if (db_get_b(NULL, "Chat", "PopupOnJoin", 0) != 0)
+ if (db_get_b(NULL, CHAT_MODULE, "PopupOnJoin", 0) != 0)
return TRUE;
// fall through
case WINDOW_VISIBLE:
@@ -2424,7 +2424,7 @@ LABEL_SHOWWINDOW:
si->bFilterEnabled = !si->bFilterEnabled;
SendDlgItemMessage(hwndDlg,IDC_FILTER,BM_SETIMAGE,IMAGE_ICON,(LPARAM)LoadIconEx( si->bFilterEnabled ? "filter" : "filter2", FALSE ));
- if (si->bFilterEnabled && db_get_b(NULL, "Chat", "RightClickFilter", 0) == 0) {
+ if (si->bFilterEnabled && db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0) {
SendMessage(hwndDlg, GC_SHOWFILTERMENU, 0, 0);
break;
}
@@ -2438,7 +2438,7 @@ LABEL_SHOWWINDOW:
cf.dwEffects = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR)) {
- if (db_get_b(NULL, "Chat", "RightClickFilter", 0) == 0)
+ if (db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_BKGCOLOR);
else if (si->bBGSet) {
cf.dwMask = CFM_BACKCOLOR;
@@ -2448,7 +2448,7 @@ LABEL_SHOWWINDOW:
}
else {
cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = (COLORREF)db_get_dw(NULL, "Chat", "ColorMessageBG", GetSysColor(COLOR_WINDOW));
+ cf.crBackColor = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
}
@@ -2461,7 +2461,7 @@ LABEL_SHOWWINDOW:
cf.dwEffects = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_COLOR)) {
- if (db_get_b(NULL, "Chat", "RightClickFilter", 0) == 0)
+ if (db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_COLOR);
else if (si->bFGSet) {
cf.dwMask = CFM_COLOR;
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index b7d79b4849..2270dc5e65 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -67,8 +67,8 @@ static const fontOptionsList[] = {
static void LoadColors()
{
- g_Settings->crUserListBGColor = db_get_dw(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW));
- g_Settings->crUserListSelectedBGColor = db_get_dw(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT));
+ g_Settings->crUserListBGColor = db_get_dw(NULL, CHAT_MODULE, "ColorNicklistBG", GetSysColor(COLOR_WINDOW));
+ g_Settings->crUserListSelectedBGColor = db_get_dw(NULL, CHAT_MODULE, "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT));
}
void LoadLogFonts(void)
@@ -93,29 +93,29 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
if (colour) {
mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
- *colour = db_get_dw(NULL, "ChatFonts", str, fontOptionsList[i].defColour);
+ *colour = db_get_dw(NULL, CHATFONT_MODULE, str, fontOptionsList[i].defColour);
}
if (lf) {
mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
- lf->lfHeight = (char)db_get_b(NULL, "ChatFonts", str, fontOptionsList[i].defSize);
+ lf->lfHeight = (char)db_get_b(NULL, CHATFONT_MODULE, str, fontOptionsList[i].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
- style = db_get_b(NULL, "ChatFonts", str, fontOptionsList[i].defStyle);
+ style = db_get_b(NULL, CHATFONT_MODULE, str, fontOptionsList[i].defStyle);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = 0;
lf->lfStrikeOut = 0;
mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
- lf->lfCharSet = db_get_b(NULL, "ChatFonts", str, fontOptionsList[i].defCharset);
+ lf->lfCharSet = db_get_b(NULL, CHATFONT_MODULE, str, fontOptionsList[i].defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "Font%d", i);
- ptrT tszFace(db_get_tsa(NULL, "ChatFonts", str));
+ ptrT tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
lstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
@@ -130,7 +130,7 @@ void RegisterFonts(void)
FontIDT fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
for (int i = 0; i < SIZEOF(fontOptionsList); i++, index++) {
- strncpy(fontid.dbSettingsGroup, "ChatFonts", sizeof(fontid.dbSettingsGroup));
+ strncpy(fontid.dbSettingsGroup, CHATFONT_MODULE, sizeof(fontid.dbSettingsGroup));
_tcsncpy(fontid.group, g_szFontGroup, SIZEOF(fontid.group));
_tcsncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
@@ -183,7 +183,7 @@ HICON LoadIconEx(char* pszIcoLibName, BOOL big)
static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, "Chat", pszSetting, &dbv)) {
+ if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrT(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
@@ -195,33 +195,33 @@ static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
void LoadGlobalSettings(void)
{
g_Settings->LogIconSize = 10;
- g_Settings->bLogLimitNames = db_get_b(NULL, "Chat", "LogLimitNames", 1) != 0;
- g_Settings->bShowTime = db_get_b(NULL, "Chat", "ShowTimeStamp", 1) != 0;
- g_Settings->bSoundsFocus = db_get_b(NULL, "Chat", "SoundsFocus", 0) != 0;
- g_Settings->bShowTimeIfChanged = (BOOL)db_get_b(NULL, "Chat", "ShowTimeStampIfChanged", 0) != 0;
- g_Settings->bTimeStampEventColour = (BOOL)db_get_b(NULL, "Chat", "TimeStampEventColour", 0) != 0;
- g_Settings->iEventLimit = db_get_w(NULL, "Chat", "LogLimit", 100);
- g_Settings->dwIconFlags = db_get_dw(NULL, "Chat", "IconFlags", 0x0000);
- g_Settings->dwTrayIconFlags = db_get_dw(NULL, "Chat", "TrayIconFlags", 0x1000);
- g_Settings->dwPopupFlags = db_get_dw(NULL, "Chat", "PopupFlags", 0x0000);
- g_Settings->LoggingLimit = db_get_w(NULL, "Chat", "LoggingLimit", 100);
- g_Settings->bLoggingEnabled = (BOOL)db_get_b(NULL, "Chat", "LoggingEnabled", 0) != 0;
- g_Settings->bFlashWindow = (BOOL)db_get_b(NULL, "Chat", "FlashWindow", 0) != 0;
- g_Settings->bFlashWindowHighlight = (BOOL)db_get_b(NULL, "Chat", "FlashWindowHighlight", false) != 0;
- g_Settings->bHighlightEnabled = (BOOL)db_get_b(NULL, "Chat", "HighlightEnabled", 1) != 0;
- g_Settings->crLogBackground = db_get_dw(NULL, "Chat", "ColorLogBG", GetSysColor(COLOR_WINDOW));
- g_Settings->crUserListColor = db_get_dw(NULL, "ChatFonts", "Font18Col", RGB(0, 0, 0));
- g_Settings->crUserListHeadingsColor = db_get_dw(NULL, "ChatFonts", "Font19Col", RGB(170, 170, 170));
- g_Settings->bStripFormat = (BOOL)db_get_b(NULL, "Chat", "StripFormatting", 0) != 0;
- g_Settings->bTrayIconInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1) != 0;
- g_Settings->bPopupInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "PopupInactiveOnly", 1) != 0;
- g_Settings->bAddColonToAutoComplete = (BOOL)db_get_b(NULL, "Chat", "AddColonToAutoComplete", 1) != 0;
- g_Settings->iPopupStyle = db_get_b(NULL, "Chat", "PopupStyle", 1);
- g_Settings->iPopupTimeout = db_get_w(NULL, "Chat", "PopupTimeout", 3);
- g_Settings->crPUBkgColour = db_get_dw(NULL, "Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
- g_Settings->crPUTextColour = db_get_dw(NULL, "Chat", "PopupColorText", 0);
- g_Settings->bShowContactStatus = db_get_b(NULL, "Chat", "ShowContactStatus", 0) != 0;
- g_Settings->bContactStatusFirst = db_get_b(NULL, "Chat", "ContactStatusFirst", 0) != 0;
+ g_Settings->bLogLimitNames = db_get_b(NULL, CHAT_MODULE, "LogLimitNames", 1) != 0;
+ g_Settings->bShowTime = db_get_b(NULL, CHAT_MODULE, "ShowTimeStamp", 1) != 0;
+ g_Settings->bSoundsFocus = db_get_b(NULL, CHAT_MODULE, "SoundsFocus", 0) != 0;
+ g_Settings->bShowTimeIfChanged = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowTimeStampIfChanged", 0) != 0;
+ g_Settings->bTimeStampEventColour = (BOOL)db_get_b(NULL, CHAT_MODULE, "TimeStampEventColour", 0) != 0;
+ g_Settings->iEventLimit = db_get_w(NULL, CHAT_MODULE, "LogLimit", 100);
+ g_Settings->dwIconFlags = db_get_dw(NULL, CHAT_MODULE, "IconFlags", 0x0000);
+ g_Settings->dwTrayIconFlags = db_get_dw(NULL, CHAT_MODULE, "TrayIconFlags", 0x1000);
+ g_Settings->dwPopupFlags = db_get_dw(NULL, CHAT_MODULE, "PopupFlags", 0x0000);
+ g_Settings->LoggingLimit = db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100);
+ g_Settings->bLoggingEnabled = (BOOL)db_get_b(NULL, CHAT_MODULE, "LoggingEnabled", 0) != 0;
+ g_Settings->bFlashWindow = (BOOL)db_get_b(NULL, CHAT_MODULE, "FlashWindow", 0) != 0;
+ g_Settings->bFlashWindowHighlight = (BOOL)db_get_b(NULL, CHAT_MODULE, "FlashWindowHighlight", false) != 0;
+ g_Settings->bHighlightEnabled = (BOOL)db_get_b(NULL, CHAT_MODULE, "HighlightEnabled", 1) != 0;
+ g_Settings->crLogBackground = db_get_dw(NULL, CHAT_MODULE, "ColorLogBG", GetSysColor(COLOR_WINDOW));
+ g_Settings->crUserListColor = db_get_dw(NULL, CHATFONT_MODULE, "Font18Col", RGB(0, 0, 0));
+ g_Settings->crUserListHeadingsColor = db_get_dw(NULL, CHATFONT_MODULE, "Font19Col", RGB(170, 170, 170));
+ g_Settings->bStripFormat = (BOOL)db_get_b(NULL, CHAT_MODULE, "StripFormatting", 0) != 0;
+ g_Settings->bTrayIconInactiveOnly = (BOOL)db_get_b(NULL, CHAT_MODULE, "TrayIconInactiveOnly", 1) != 0;
+ g_Settings->bPopupInactiveOnly = (BOOL)db_get_b(NULL, CHAT_MODULE, "PopupInactiveOnly", 1) != 0;
+ g_Settings->bAddColonToAutoComplete = (BOOL)db_get_b(NULL, CHAT_MODULE, "AddColonToAutoComplete", 1) != 0;
+ g_Settings->iPopupStyle = db_get_b(NULL, CHAT_MODULE, "PopupStyle", 1);
+ g_Settings->iPopupTimeout = db_get_w(NULL, CHAT_MODULE, "PopupTimeout", 3);
+ g_Settings->crPUBkgColour = db_get_dw(NULL, CHAT_MODULE, "PopupColorBG", GetSysColor(COLOR_WINDOW));
+ g_Settings->crPUTextColour = db_get_dw(NULL, CHAT_MODULE, "PopupColorText", 0);
+ g_Settings->bShowContactStatus = db_get_b(NULL, CHAT_MODULE, "ShowContactStatus", 0) != 0;
+ g_Settings->bContactStatusFirst = db_get_b(NULL, CHAT_MODULE, "ContactStatusFirst", 0) != 0;
LoadColors();
@@ -235,7 +235,7 @@ void LoadGlobalSettings(void)
InitSetting(&g_Settings->pszHighlightWords, "HighlightWords", _T("%m"));
InitSetting(&g_Settings->pszLogDir, "LogDirectory", _T("%miranda_logpath%\\%proto%\\%userid%.log"));
- g_Settings->bLogIndentEnabled = db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0;
+ g_Settings->bLogIndentEnabled = db_get_b(NULL, CHAT_MODULE, "LogIndentEnabled", 1) != 0;
LOGFONT lf;
if (g_Settings->MessageBoxFont)
@@ -314,13 +314,13 @@ int OptionsInit(void)
g_Settings->UserListFont = NULL;
g_Settings->UserListHeadingsFont = NULL;
g_Settings->MessageBoxFont = NULL;
- g_Settings->iWidth = db_get_dw(NULL, "Chat", "roomwidth", -1);
- g_Settings->iHeight = db_get_dw(NULL, "Chat", "roomheight", -1);
+ g_Settings->iWidth = db_get_dw(NULL, CHAT_MODULE, "roomwidth", -1);
+ g_Settings->iHeight = db_get_dw(NULL, CHAT_MODULE, "roomheight", -1);
- g_Settings->iSplitterX = db_get_w(NULL, "Chat", "SplitterX", 105);
+ g_Settings->iSplitterX = db_get_w(NULL, CHAT_MODULE, "SplitterX", 105);
if (g_Settings->iSplitterX <= 50)
g_Settings->iSplitterX = 105;
- g_Settings->iSplitterY = db_get_w(NULL, "Chat", "SplitterY", 90);
+ g_Settings->iSplitterY = db_get_w(NULL, CHAT_MODULE, "SplitterY", 90);
if (g_Settings->iSplitterY <= 65)
g_Settings->iSplitterY = 90;
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index bae1a2016e..5b3b2df05a 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -79,7 +79,7 @@ static int FontsChanged(WPARAM wParam, LPARAM lParam)
LoadMsgLogBitmaps();
SetIndentSize();
- g_Settings->bLogIndentEnabled = (db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings->bLogIndentEnabled = (db_get_b(NULL, CHAT_MODULE, "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
ci.MM_FontsChanged();
ci.MM_FixColors();
@@ -214,9 +214,9 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->ptszStatusbarText = mir_tstrdup(gcw->ptszStatusbarText);
si->iSplitterX = g_Settings->iSplitterX;
si->iSplitterY = g_Settings->iSplitterY;
- si->iLogFilterFlags = (int)db_get_dw(NULL, "Chat", "FilterFlags", 0x03E0);
- si->bFilterEnabled = db_get_b(NULL, "Chat", "FilterEnabled", 0);
- si->bNicklistEnabled = db_get_b(NULL, "Chat", "ShowNicklist", 1);
+ si->iLogFilterFlags = (int)db_get_dw(NULL, CHAT_MODULE, "FilterFlags", 0x03E0);
+ si->bFilterEnabled = db_get_b(NULL, CHAT_MODULE, "FilterEnabled", 0);
+ si->bNicklistEnabled = db_get_b(NULL, CHAT_MODULE, "ShowNicklist", 1);
if (mi->bColor) {
si->iFG = 4;
@@ -286,7 +286,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
case SESSION_INITDONE:
if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
SetInitDone(si);
- if (wp != SESSION_INITDONE || db_get_b(NULL, "Chat", "PopupOnJoin", 0) == 0)
+ if (wp != SESSION_INITDONE || db_get_b(NULL, CHAT_MODULE, "PopupOnJoin", 0) == 0)
ci.ShowRoom(si, wp, TRUE);
return 0;
}
@@ -440,7 +440,7 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
db_set_ts(si->hContact, si->pszModule, "Topic", si->ptszTopic);
if (ci.OnSetTopic)
ci.OnSetTopic(si);
- if (db_get_b(NULL, "Chat", "TopicOnClist", 0))
+ if (db_get_b(NULL, CHAT_MODULE, "TopicOnClist", 0))
db_set_ts(si->hContact, "CList", "StatusMsg", si->ptszTopic);
}
}
@@ -551,7 +551,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
HookEvent(ME_SMILEYADD_OPTIONSCHANGED, SmileyOptionsChanged);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
- char* mods[3] = { "Chat", "ChatFonts" };
+ char* mods[3] = { CHAT_MODULE, CHATFONT_MODULE };
CallService("DBEditorpp/RegisterModule", (WPARAM)mods, 2);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp
index 658076cd09..ce9680cb32 100644
--- a/src/modules/chat/clist.cpp
+++ b/src/modules/chat/clist.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HANDLE AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType)
{
TCHAR pszGroup[50]; *pszGroup = '\0';
- ptrT groupName(db_get_tsa(NULL, "Chat", "AddToGroup"));
+ ptrT groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
_tcsncpy_s(pszGroup, SIZEOF(pszGroup), groupName, _TRUNCATE);
else
@@ -121,7 +121,7 @@ int RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
if (si) {
// is the "toggle visibility option set, so we need to close the window?
if (si->hWnd != NULL &&
- db_get_b(NULL, "Chat", "ToggleVisibility", 0) == 1 &&
+ db_get_b(NULL, CHAT_MODULE, "ToggleVisibility", 0) == 1 &&
!CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, 0) &&
IsWindowVisible(si->hWnd) && !IsIconic(si->hWnd))
{
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index 36e25f3e29..42022b7c38 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -389,7 +389,7 @@ void CheckColorsInModule(const char *pszModule)
MODULEINFO *pMod = ci.MM_FindModule(pszModule);
int i = 0;
COLORREF crFG;
- COLORREF crBG = (COLORREF)db_get_dw(NULL, "Chat", "ColorMessageBG", GetSysColor(COLOR_WINDOW));
+ COLORREF crBG = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
LoadMsgDlgFont(17, NULL, &crFG);