summaryrefslogtreecommitdiff
path: root/src/core
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/core
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/core')
-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
4 files changed, 101 insertions, 101 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;