diff options
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/chat/main.cpp | 104 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/muchighlight.cpp | 26 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/options.cpp | 108 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/tools.cpp | 20 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/window.cpp | 56 | ||||
-rw-r--r-- | plugins/TabSRMM/src/eventpopups.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/infopanel.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/themeio.cpp | 53 |
11 files changed, 197 insertions, 186 deletions
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index d591af8046..1d3bbed584 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -131,36 +131,36 @@ static void OnCreateModule(MODULEINFO *mi) static void OnLoadSettings()
{
- g_Settings.iEventLimitThreshold = db_get_w(NULL, "Chat", "LogLimitThreshold", 20);
- g_Settings.dwIconFlags = M.GetDword("Chat", "IconFlags", 0x0000);
- g_Settings.bOpenInDefault = M.GetBool("Chat", "DefaultContainer", true);
- g_Settings.UserListColors[CHAT_STATUS_NORMAL] = M.GetDword(CHAT_FONTMODULE, "Font18Col", RGB(0, 0, 0));
- g_Settings.UserListColors[CHAT_STATUS_AWAY] = M.GetDword(CHAT_FONTMODULE, "Font19Col", RGB(170, 170, 170));
- g_Settings.UserListColors[CHAT_STATUS_OFFLINE] = M.GetDword(CHAT_FONTMODULE, "Font5Col", RGB(160, 90, 90));
- g_Settings.bBBCodeInPopups = M.GetByte("Chat", "BBCodeInPopups", 0) != 0;
- g_Settings.bClassicIndicators = M.GetBool("Chat", "ClassicIndicators", false);
- g_Settings.bLogClassicIndicators = M.GetBool("Chat", "LogClassicIndicators", false);
- g_Settings.bAlternativeSorting = M.GetBool("Chat", "AlternativeSorting", true);
- g_Settings.bAnnoyingHighlight = M.GetBool("Chat", "AnnoyingHighlight", false);
- g_Settings.bCreateWindowOnHighlight = M.GetBool("Chat", "CreateWindowOnHighlight", true);
-
- g_Settings.bLogSymbols = M.GetBool("Chat", "LogSymbols", true);
- g_Settings.bClickableNicks = M.GetBool("Chat", "ClickableNicks", true);
- g_Settings.bColorizeNicks = M.GetBool("Chat", "ColorizeNicks", true);
- g_Settings.bColorizeNicksInLog = M.GetBool("Chat", "ColorizeNicksInLog", true);
- g_Settings.bScaleIcons = M.GetBool("Chat", "ScaleIcons", true);
- g_Settings.bUseDividers = M.GetBool("Chat", "UseDividers", true);
- g_Settings.bDividersUsePopupConfig = M.GetBool("Chat", "DividersUsePopupConfig", true);
-
- g_Settings.bDoubleClick4Privat = M.GetBool("Chat", "DoubleClick4Privat", false);
- g_Settings.bShowContactStatus = M.GetBool("Chat", "ShowContactStatus", true);
- g_Settings.bContactStatusFirst = M.GetBool("Chat", "ContactStatusFirst", false);
+ g_Settings.iEventLimitThreshold = db_get_w(NULL, CHAT_MODULE, "LogLimitThreshold", 20);
+ g_Settings.dwIconFlags = M.GetDword(CHAT_MODULE, "IconFlags", 0x0000);
+ g_Settings.bOpenInDefault = M.GetBool(CHAT_MODULE, "DefaultContainer", true);
+ g_Settings.UserListColors[CHAT_STATUS_NORMAL] = M.GetDword(CHATFONT_MODULE, "Font18Col", RGB(0, 0, 0));
+ g_Settings.UserListColors[CHAT_STATUS_AWAY] = M.GetDword(CHATFONT_MODULE, "Font19Col", RGB(170, 170, 170));
+ g_Settings.UserListColors[CHAT_STATUS_OFFLINE] = M.GetDword(CHATFONT_MODULE, "Font5Col", RGB(160, 90, 90));
+ g_Settings.bBBCodeInPopups = M.GetByte(CHAT_MODULE, "BBCodeInPopups", 0) != 0;
+ g_Settings.bClassicIndicators = M.GetBool(CHAT_MODULE, "ClassicIndicators", false);
+ g_Settings.bLogClassicIndicators = M.GetBool(CHAT_MODULE, "LogClassicIndicators", false);
+ g_Settings.bAlternativeSorting = M.GetBool(CHAT_MODULE, "AlternativeSorting", true);
+ g_Settings.bAnnoyingHighlight = M.GetBool(CHAT_MODULE, "AnnoyingHighlight", false);
+ g_Settings.bCreateWindowOnHighlight = M.GetBool(CHAT_MODULE, "CreateWindowOnHighlight", true);
+
+ g_Settings.bLogSymbols = M.GetBool(CHAT_MODULE, "LogSymbols", true);
+ g_Settings.bClickableNicks = M.GetBool(CHAT_MODULE, "ClickableNicks", true);
+ g_Settings.bColorizeNicks = M.GetBool(CHAT_MODULE, "ColorizeNicks", true);
+ g_Settings.bColorizeNicksInLog = M.GetBool(CHAT_MODULE, "ColorizeNicksInLog", true);
+ g_Settings.bScaleIcons = M.GetBool(CHAT_MODULE, "ScaleIcons", true);
+ g_Settings.bUseDividers = M.GetBool(CHAT_MODULE, "UseDividers", true);
+ g_Settings.bDividersUsePopupConfig = M.GetBool(CHAT_MODULE, "DividersUsePopupConfig", true);
+
+ g_Settings.bDoubleClick4Privat = M.GetBool(CHAT_MODULE, "DoubleClick4Privat", false);
+ g_Settings.bShowContactStatus = M.GetBool(CHAT_MODULE, "ShowContactStatus", true);
+ g_Settings.bContactStatusFirst = M.GetBool(CHAT_MODULE, "ContactStatusFirst", false);
replaceStrT(g_Settings.pszLogDir, M.getChatLogPath());
g_Settings.LogIconSize = (g_Settings.bScaleIcons) ? 12 : 16;
- g_Settings.iSplitterY = db_get_w(NULL, "Chat", "splitY", 50);
+ g_Settings.iSplitterY = db_get_w(NULL, CHAT_MODULE, "splitY", 50);
if (g_Settings.iSplitterY <= 20)
g_Settings.iSplitterY = 50;
@@ -183,17 +183,15 @@ static void OnLoadSettings() int ih = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListFonts[CHAT_STATUS_NORMAL], false);
int ih2 = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListFonts[CHAT_STATUS_AWAY], false);
- g_Settings.iNickListFontHeight = max(M.GetByte("Chat", "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
+ g_Settings.iNickListFontHeight = max(M.GetByte(CHAT_MODULE, "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
for (int i = 0; i < 7; i++) {
char szBuf[40];
mir_snprintf(szBuf, 20, "NickColor%d", i);
- g_Settings.nickColors[i] = M.GetDword("Chat", szBuf, g_Settings.UserListColors[0]);
+ g_Settings.nickColors[i] = M.GetDword(CHAT_MODULE, szBuf, g_Settings.UserListColors[0]);
}
- g_Settings.nickColors[5] = M.GetDword("Chat", "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
- g_Settings.nickColors[6] = M.GetDword("Chat", "NickColor6", GetSysColor(COLOR_HIGHLIGHTTEXT));
-
- g_Settings.crLogBackground = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR);
+ g_Settings.nickColors[5] = M.GetDword(CHAT_MODULE, "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
+ g_Settings.nickColors[6] = M.GetDword(CHAT_MODULE, "NickColor6", GetSysColor(COLOR_HIGHLIGHTTEXT));
if (g_Settings.SelectionBGBrush)
DeleteObject(g_Settings.SelectionBGBrush);
@@ -224,28 +222,36 @@ static int CopyChatSetting(const char *szSetting, LPARAM param) static void CheckUpdate()
{
// already converted?
- if (db_get_b(NULL, "Compatibility", "TabChatFonts", false))
+ int compat = db_get_b(NULL, "Compatibility", "TabChatFonts", 0);
+ if (compat >= 2)
return;
- LIST<char> szSettings(120);
-
- DBCONTACTENUMSETTINGS dbces = { 0 };
- dbces.szModule = CHAT_OLDFONTMODULE;
- dbces.pfnEnumProc = CopyChatSetting;
- dbces.lParam = (LPARAM)&szSettings;
- CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
-
- DBVARIANT dbv;
- for (int i = szSettings.getCount() - 1; i >= 0; i--) {
- char *p = szSettings[i];
- db_get(NULL, CHAT_OLDFONTMODULE, p, &dbv);
- db_set(NULL, CHAT_FONTMODULE, p, &dbv);
- db_free(&dbv);
- mir_free(p);
+ if (compat == 0) {
+ LIST<char> szSettings(120);
+
+ DBCONTACTENUMSETTINGS dbces = { 0 };
+ dbces.szModule = CHAT_OLDFONTMODULE;
+ dbces.pfnEnumProc = CopyChatSetting;
+ dbces.lParam = (LPARAM)&szSettings;
+ CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
+
+ DBVARIANT dbv;
+ for (int i = szSettings.getCount() - 1; i >= 0; i--) {
+ char *p = szSettings[i];
+ db_get(NULL, CHAT_OLDFONTMODULE, p, &dbv);
+ db_set(NULL, CHATFONT_MODULE, p, &dbv);
+ db_free(&dbv);
+ mir_free(p);
+ }
+
+ CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)CHAT_OLDFONTMODULE);
}
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)CHAT_OLDFONTMODULE);
- db_set_b(NULL, "Compatibility", "TabChatFonts", true);
+ DWORD oldBackColor = db_get_dw(0, FONTMODULE, "BkgColourMUC", SRMSGDEFSET_BKGCOLOUR);
+ db_set_dw(NULL, CHAT_MODULE, "ColorLogBG", oldBackColor);
+ db_unset(0, FONTMODULE, "BkgColourMUC");
+
+ db_set_b(NULL, "Compatibility", "TabChatFonts", 2);
}
int Chat_Load()
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index f2161f769d..ca3fac39f9 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -53,17 +53,17 @@ void CMUCHighlight::init() m_fInitialized = true;
- if (0 == db_get_ts(0, "Chat", "HighlightWords", &dbv)) {
+ if (0 == db_get_ts(0, CHAT_MODULE, "HighlightWords", &dbv)) {
m_TextPatternString = dbv.ptszVal;
_wsetlocale(LC_ALL, L"");
wcslwr(m_TextPatternString);
}
- if (0 == db_get_ts(0, "Chat", "HighlightNames", &dbv))
+ if (0 == db_get_ts(0, CHAT_MODULE, "HighlightNames", &dbv))
m_NickPatternString = dbv.ptszVal;
- m_dwFlags = M.GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
- m_fHighlightMe = (M.GetByte("Chat", "HighlightMe", 1) ? true : false);
+ m_dwFlags = M.GetByte(CHAT_MODULE, "HighlightEnabled", MATCH_TEXT);
+ m_fHighlightMe = (M.GetByte(CHAT_MODULE, "HighlightMe", 1) ? true : false);
__try {
tokenize(m_TextPatternString, m_TextPatterns, m_iTextPatterns);
@@ -260,22 +260,22 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv = {0};
- if ( !db_get_ts(0, "Chat", "HighlightWords", &dbv)) {
+ if ( !db_get_ts(0, CHAT_MODULE, "HighlightWords", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- if ( !db_get_ts(0, "Chat", "HighlightNames", &dbv)) {
+ if ( !db_get_ts(0, CHAT_MODULE, "HighlightNames", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- DWORD dwFlags = M.GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
+ DWORD dwFlags = M.GetByte(CHAT_MODULE, "HighlightEnabled", MATCH_TEXT);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTNICKENABLE, dwFlags & MATCH_NICKNAME ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTNICKUID, dwFlags & MATCH_UIN ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTTEXTENABLE, dwFlags & MATCH_TEXT ? BST_CHECKED : BST_UNCHECKED);
- ::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTME, M.GetByte("Chat", "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
+ ::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTME, M.GetByte(CHAT_MODULE, "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
::SendMessage(hwndDlg, WM_USER + 100, 0, 0);
}
@@ -317,16 +317,16 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_alloc((iLen + 2) * sizeof(wchar_t)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, szBuf, iLen + 1);
- db_set_ts(0, "Chat", "HighlightNames",szBuf);
+ db_set_ts(0, CHAT_MODULE, "HighlightNames",szBuf);
}
iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
if (iLen) {
szBuf = reinterpret_cast<TCHAR *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
- db_set_ts(0, "Chat", "HighlightWords", szBuf);
+ db_set_ts(0, CHAT_MODULE, "HighlightWords", szBuf);
}
- else db_set_ts(0, "Chat", "HighlightWords", L"");
+ else db_set_ts(0, CHAT_MODULE, "HighlightWords", L"");
mir_free(szBuf);
BYTE dwFlags = (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKENABLE) ? MATCH_NICKNAME : 0) |
@@ -335,8 +335,8 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (dwFlags & MATCH_NICKNAME)
dwFlags |= (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKUID) ? MATCH_UIN : 0);
- db_set_b(0, "Chat", "HighlightEnabled", dwFlags);
- db_set_b(0, "Chat", "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
+ db_set_b(0, CHAT_MODULE, "HighlightEnabled", dwFlags);
+ db_set_b(0, CHAT_MODULE, "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
g_Settings.Highlight->init();
}
return TRUE;
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 2ef1c550c1..3b8f73bc92 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -63,9 +63,8 @@ struct ColorOptionsList * (GetSysColor(default_color & 0x00ffffff)), not a rgb value.
*/
static ColorOptionsList _clrs[] = {
- { 0, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), LPGENT("Group chat log background"), SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR },
- { 1, LPGENT("Message Sessions"), LPGENT("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR },
- { 2, LPGENT("Message Sessions"), LPGENT("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR },
+ { 0, LPGENT("Message Sessions"), LPGENT("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR },
+ { 1, LPGENT("Message Sessions"), LPGENT("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR },
{ 0, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), LPGENT("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR },
{ 1, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), LPGENT("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR },
{ 2, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), LPGENT("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR },
@@ -223,7 +222,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "Font%d", i);
- if ((i == 17 && !strcmp(szMod, CHAT_FONTMODULE)) || ((i == 20 || i == 21) && !strcmp(szMod, FONTMODULE))) {
+ if ((i == 17 && !strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
lstrcpyn(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
}
@@ -264,9 +263,9 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, branch_t *branch, int n tvis.item.pszText = TranslateTS(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
- iState = ((M.GetDword("Chat", branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0 ? 3 : 2;
+ iState = ((M.GetDword(CHAT_MODULE, branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0 ? 3 : 2;
else
- iState = M.GetByte("Chat", branch[i].szDBName, branch[i].bDefault) != 0 ? 3 : 2;
+ iState = M.GetByte(CHAT_MODULE, branch[i].szDBName, branch[i].bDefault) != 0 ? 3 : 2;
tvis.item.state = INDEXTOSTATEIMAGEMASK(iState);
branch[i].hItem = TreeView_InsertItem(hwndTree, &tvis);
}
@@ -288,9 +287,9 @@ static void SaveBranch(HWND hwndTree, branch_t *branch, int nValues) iState |= branch[i].iMode;
if (iState & GC_EVENT_ADDSTATUS)
iState |= GC_EVENT_REMOVESTATUS;
- db_set_dw(0, "Chat", branch[i].szDBName, (DWORD)iState);
+ db_set_dw(0, CHAT_MODULE, branch[i].szDBName, (DWORD)iState);
}
- else db_set_b(0, "Chat", branch[i].szDBName, bChecked);
+ else db_set_b(0, CHAT_MODULE, branch[i].szDBName, bChecked);
}
}
@@ -412,7 +411,7 @@ HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY) static void InitSetting(TCHAR* &ppPointer, const char *pszSetting, const TCHAR *pszDefault)
{
- ptrT val( db_get_tsa(NULL, "Chat", pszSetting));
+ ptrT val( db_get_tsa(NULL, CHAT_MODULE, pszSetting));
replaceStrT(ppPointer, (val != NULL) ? val : pszDefault);
}
@@ -534,13 +533,13 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (iLen > 0) {
pszText = (TCHAR*)mir_realloc(pszText, (iLen + 2) * 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_ts(NULL, "Chat", "AddToGroup", _T(""));
+ else db_set_ts(NULL, CHAT_MODULE, "AddToGroup", _T(""));
mir_free(pszText);
- b = M.GetByte("Chat", "Tabs", 1);
+ b = M.GetByte(CHAT_MODULE, "Tabs", 1);
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, SIZEOF(branch1));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, SIZEOF(branch2));
@@ -557,9 +556,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case WM_DESTROY:
BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
- db_set_b(0, "Chat", "Branch1Exp", b);
+ db_set_b(0, CHAT_MODULE, "Branch1Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
- db_set_b(0, "Chat", "Branch2Exp", b);
+ db_set_b(0, CHAT_MODULE, "Branch2Exp", b);
}
return FALSE;
}
@@ -674,7 +673,7 @@ void RegisterFontServiceFonts() { }
_tcsncpy(cid.group, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), SIZEOF(cid.group));
- strncpy(cid.dbSettingsGroup, "Chat", SIZEOF(cid.dbSettingsGroup));
+ strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup));
for (int i = 0; i <= 7; i++) {
mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
_tcsncpy(cid.name, chatcolorsnames[i], SIZEOF(cid.name));
@@ -693,12 +692,17 @@ void RegisterFontServiceFonts() { }
ColourRegisterT(&cid);
}
- cid.order = 8;
- _tcsncpy(cid.name, LPGENT("Userlist background"), SIZEOF(cid.name));
- strncpy(cid.setting, "ColorNicklistBG", SIZEOF(cid.setting));
+ cid.order++;
+ _tcsncpy_s(cid.name, SIZEOF(cid.name), LPGENT("Userlist background"), _TRUNCATE);
+ strncpy_s(cid.setting, SIZEOF(cid.setting), "ColorNicklistBG", _TRUNCATE);
cid.defcolour = SRMSGDEFSET_BKGCOLOUR;
ColourRegisterT(&cid);
+ cid.order++;
+ _tcsncpy_s(cid.name, SIZEOF(cid.name), LPGENT("Group chat log background"), _TRUNCATE);
+ strncpy_s(cid.setting, SIZEOF(cid.setting), "ColorLogBG", _TRUNCATE);
+ ColourRegisterT(&cid);
+
// static colors (info panel, tool bar background etc...)
strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
strncpy(cid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
@@ -762,9 +766,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg);
{
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETRANGE, 0, MAKELONG(5000, 0));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "Chat", "LogLimit", 100), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LogLimit", 100), 0));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETRANGE, 0, MAKELONG(255, 10));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(M.GetByte("Chat", "NicklistRowDist", 12), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(M.GetByte(CHAT_MODULE, "NicklistRowDist", 12), 0));
SetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, g_Settings.pszTimeStampLog);
SetDlgItemText(hwndDlg, IDC_TIMESTAMP, g_Settings.pszTimeStamp);
SetDlgItemText(hwndDlg, IDC_OUTSTAMP, g_Settings.pszOutgoingNick);
@@ -774,7 +778,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM Utils::enableDlgControl(hwndDlg, IDC_LOGDIRECTORY, g_Settings.bLoggingEnabled);
Utils::enableDlgControl(hwndDlg, IDC_FONTCHOOSE, g_Settings.bLoggingEnabled);
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_SETRANGE, 0, MAKELONG(10000, 0));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "Chat", "LoggingLimit", 100), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100), 0));
Utils::enableDlgControl(hwndDlg, IDC_LIMIT, g_Settings.bLoggingEnabled);
if (ServiceExists(MS_UTILS_REPLACEVARS)) {
@@ -924,61 +928,61 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (iLen > 0) {
TCHAR *pszText1 = (TCHAR*)mir_alloc(iLen*sizeof(TCHAR) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
- db_set_ts(NULL, "Chat", "LogDirectory", pszText1);
+ db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
mir_free(pszText1);
g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_LOGGING) == BST_CHECKED;
- db_set_b(0, "Chat", "LoggingEnabled", g_Settings.bLoggingEnabled);
+ db_set_b(0, CHAT_MODULE, "LoggingEnabled", g_Settings.bLoggingEnabled);
}
else {
- db_unset(NULL, "Chat", "LogDirectory");
- db_set_b(0, "Chat", "LoggingEnabled", 0);
+ db_unset(NULL, CHAT_MODULE, "LogDirectory");
+ db_set_b(0, CHAT_MODULE, "LoggingEnabled", 0);
}
pci->SM_InvalidateLogDirectories();
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_GETPOS, 0, 0);
- db_set_w(NULL, "Chat", "LoggingLimit", (WORD)iLen);
+ db_set_w(NULL, CHAT_MODULE, "LoggingLimit", (WORD)iLen);
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
if (iLen > 0)
- db_set_b(0, "Chat", "NicklistRowDist", (BYTE)iLen);
+ db_set_b(0, CHAT_MODULE, "NicklistRowDist", (BYTE)iLen);
else
- db_unset(NULL, "Chat", "NicklistRowDist");
+ db_unset(NULL, CHAT_MODULE, "NicklistRowDist");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP));
if (iLen > 0) {
pszText = (char *)mir_realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
- db_set_s(NULL, "Chat", "LogTimestamp", pszText);
- } else db_unset(NULL, "Chat", "LogTimestamp");
+ db_set_s(NULL, CHAT_MODULE, "LogTimestamp", pszText);
+ } else db_unset(NULL, CHAT_MODULE, "LogTimestamp");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
pszText = (char *)mir_realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
- db_set_s(NULL, "Chat", "HeaderTime", pszText);
- } else db_unset(NULL, "Chat", "HeaderTime");
+ db_set_s(NULL, CHAT_MODULE, "HeaderTime", pszText);
+ } else db_unset(NULL, CHAT_MODULE, "HeaderTime");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
pszText = (char *)mir_realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
- db_set_s(NULL, "Chat", "HeaderIncoming", pszText);
- } else db_unset(NULL, "Chat", "HeaderIncoming");
+ db_set_s(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
+ } else db_unset(NULL, CHAT_MODULE, "HeaderIncoming");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
pszText = (char *)mir_realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
- db_set_s(NULL, "Chat", "HeaderOutgoing", pszText);
- } else db_unset(NULL, "Chat", "HeaderOutgoing");
+ db_set_s(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
+ } else db_unset(NULL, CHAT_MODULE, "HeaderOutgoing");
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
- db_set_w(NULL, "Chat", "LogLimit", (WORD)iLen);
+ db_set_w(NULL, CHAT_MODULE, "LogLimit", (WORD)iLen);
mir_free(pszText);
if (pci->hListBkgBrush)
DeleteObject(pci->hListBkgBrush);
- pci->hListBkgBrush = CreateSolidBrush(M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ pci->hListBkgBrush = CreateSolidBrush(M.GetDword(CHAT_MODULE, "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
pci->ReloadSettings();
pci->MM_FontsChanged();
@@ -1043,10 +1047,10 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- DWORD dwFilterFlags = M.GetDword("Chat", "FilterFlags", GC_EVENT_ALL);
- DWORD dwTrayFlags = M.GetDword("Chat", "TrayIconFlags", GC_EVENT_HIGHLIGHT);
- DWORD dwPopupFlags = M.GetDword("Chat", "PopupFlags", GC_EVENT_HIGHLIGHT);
- DWORD dwLogFlags = M.GetDword("Chat", "DiskLogFlags", GC_EVENT_ALL);
+ DWORD dwFilterFlags = M.GetDword(CHAT_MODULE, "FilterFlags", GC_EVENT_ALL);
+ DWORD dwTrayFlags = M.GetDword(CHAT_MODULE, "TrayIconFlags", GC_EVENT_HIGHLIGHT);
+ DWORD dwPopupFlags = M.GetDword(CHAT_MODULE, "PopupFlags", GC_EVENT_HIGHLIGHT);
+ DWORD dwLogFlags = M.GetDword(CHAT_MODULE, "DiskLogFlags", GC_EVENT_ALL);
for (int i=0; i < SIZEOF(_eventorder); i++) {
if (_eventorder[i] != GC_EVENT_HIGHLIGHT) {
@@ -1063,8 +1067,8 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM SendDlgItemMessage(hwndDlg, IDC_LOGICONTYPE, CB_SETCURSEL, (g_Settings.bLogSymbols ? 2 : (g_Settings.dwIconFlags ? 1 : 0)), 0);
- CheckDlgButton(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS, M.GetByte("Chat", "SkipWhenNoWindow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRAYONLYFORINACTIVE, M.GetByte("Chat", "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS, M.GetByte(CHAT_MODULE, "SkipWhenNoWindow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRAYONLYFORINACTIVE, M.GetByte(CHAT_MODULE, "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
break;
case WM_COMMAND:
@@ -1088,18 +1092,18 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM dwPopupFlags |= (IsDlgButtonChecked(hwndDlg, IDC_P1 + i) ? _eventorder[i] : 0);
dwTrayFlags |= (IsDlgButtonChecked(hwndDlg, IDC_T1 + i) ? _eventorder[i] : 0);
}
- db_set_dw(0, "Chat", "FilterFlags", dwFilterFlags);
- db_set_dw(0, "Chat", "PopupFlags", dwPopupFlags);
- db_set_dw(0, "Chat", "TrayIconFlags", dwTrayFlags);
- db_set_dw(0, "Chat", "DiskLogFlags", dwLogFlags);
+ db_set_dw(0, CHAT_MODULE, "FilterFlags", dwFilterFlags);
+ db_set_dw(0, CHAT_MODULE, "PopupFlags", dwPopupFlags);
+ db_set_dw(0, CHAT_MODULE, "TrayIconFlags", dwTrayFlags);
+ db_set_dw(0, CHAT_MODULE, "DiskLogFlags", dwLogFlags);
LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_LOGICONTYPE, CB_GETCURSEL, 0, 0);
- db_set_dw(0, "Chat", "IconFlags", lr == 1 ? 1 : 0);
- db_set_b(0, "Chat", "LogSymbols", lr == 2 ? 1 : 0);
+ db_set_dw(0, CHAT_MODULE, "IconFlags", lr == 1 ? 1 : 0);
+ db_set_b(0, CHAT_MODULE, "LogSymbols", lr == 2 ? 1 : 0);
- db_set_b(0, "Chat", "SkipWhenNoWindow", IsDlgButtonChecked(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS) ? 1 : 0);
- db_set_b(0, "Chat", "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
+ db_set_b(0, CHAT_MODULE, "SkipWhenNoWindow", IsDlgButtonChecked(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS) ? 1 : 0);
+ db_set_b(0, CHAT_MODULE, "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
pci->ReloadSettings();
pci->MM_FontsChanged();
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 7419a3851a..77a5a4d70d 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -633,29 +633,29 @@ void Chat_SetFilters(SESSION_INFO *si) if (si == NULL)
return;
- DWORD dwFlags_default = M.GetDword("Chat", "FilterFlags", 0x03E0);
- DWORD dwFlags_local = db_get_dw(si->hContact, "Chat", "FilterFlags", 0x03E0);
- DWORD dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
+ DWORD dwFlags_default = M.GetDword(CHAT_MODULE, "FilterFlags", 0x03E0);
+ DWORD dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "FilterFlags", 0x03E0);
+ DWORD dwMask = db_get_dw(si->hContact, CHAT_MODULE, "FilterMask", 0);
si->iLogFilterFlags = dwFlags_default;
for (int i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogFilterFlags = (dwFlags_local & (1 << i) ? si->iLogFilterFlags | (1 << i) : si->iLogFilterFlags & ~(1 << i));
- dwFlags_default = M.GetDword("Chat", "PopupFlags", 0x03E0);
- dwFlags_local = db_get_dw(si->hContact, "Chat", "PopupFlags", 0x03E0);
- dwMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
+ dwFlags_default = M.GetDword(CHAT_MODULE, "PopupFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "PopupFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, CHAT_MODULE, "PopupMask", 0);
si->iLogPopupFlags = dwFlags_default;
for (int i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogPopupFlags = (dwFlags_local & (1 << i) ? si->iLogPopupFlags | (1 << i) : si->iLogPopupFlags & ~(1 << i));
- dwFlags_default = M.GetDword("Chat", "TrayIconFlags", 0x03E0);
- dwFlags_local = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0x03E0);
- dwMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
+ dwFlags_default = M.GetDword(CHAT_MODULE, "TrayIconFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "TrayIconFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, CHAT_MODULE, "TrayIconMask", 0);
- si->iDiskLogFlags = M.GetDword("Chat", "DiskLogFlags", 0xFFFF);
+ si->iDiskLogFlags = M.GetDword(CHAT_MODULE, "DiskLogFlags", 0xFFFF);
si->iLogTrayFlags = dwFlags_default;
for (int i=0; i < 32; i++)
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 27634ff775..4280716d4b 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -60,7 +60,7 @@ static const CLSID IID_ITextDocument= { 0x8CC497C0,0xA1DF,0x11CE, { 0x80,0x98, 0 static void Chat_SetMessageLog(TWindowData *dat)
{
- unsigned int iLogMode = M.GetByte("Chat", "useIEView", 0);
+ unsigned int iLogMode = M.GetByte(CHAT_MODULE, "useIEView", 0);
if (iLogMode == WANT_IEVIEW_LOG && dat->hwndIEView == 0) {
IEVIEWWINDOW ieWindow;
@@ -1100,14 +1100,14 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case WM_INITDIALOG:
{
si = (SESSION_INFO*)lParam;
- DWORD dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
- DWORD dwFlags = db_get_dw(si->hContact, "Chat", "FilterFlags", 0);
+ DWORD dwMask = db_get_dw(si->hContact, CHAT_MODULE, "FilterMask", 0);
+ DWORD dwFlags = db_get_dw(si->hContact, CHAT_MODULE, "FilterFlags", 0);
- DWORD dwPopupMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
- DWORD dwPopupFlags = db_get_dw(si->hContact, "Chat", "PopupFlags", 0);
+ DWORD dwPopupMask = db_get_dw(si->hContact, CHAT_MODULE, "PopupMask", 0);
+ DWORD dwPopupFlags = db_get_dw(si->hContact, CHAT_MODULE, "PopupFlags", 0);
- DWORD dwTrayMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
- DWORD dwTrayFlags = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0);
+ DWORD dwTrayMask = db_get_dw(si->hContact, CHAT_MODULE, "TrayIconMask", 0);
+ DWORD dwTrayFlags = db_get_dw(si->hContact, CHAT_MODULE, "TrayIconFlags", 0);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)si);
@@ -1141,12 +1141,12 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP if (si) {
if (dwMask == 0) {
- db_unset(si->hContact, "Chat", "FilterFlags");
- db_unset(si->hContact, "Chat", "FilterMask");
+ db_unset(si->hContact, CHAT_MODULE, "FilterFlags");
+ db_unset(si->hContact, CHAT_MODULE, "FilterMask");
}
else {
- db_set_dw(si->hContact, "Chat", "FilterFlags", iFlags);
- db_set_dw(si->hContact, "Chat", "FilterMask", dwMask);
+ db_set_dw(si->hContact, CHAT_MODULE, "FilterFlags", iFlags);
+ db_set_dw(si->hContact, CHAT_MODULE, "FilterMask", dwMask);
}
}
@@ -1163,12 +1163,12 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP if (si) {
if (dwMask == 0) {
- db_unset(si->hContact, "Chat", "PopupFlags");
- db_unset(si->hContact, "Chat", "PopupMask");
+ db_unset(si->hContact, CHAT_MODULE, "PopupFlags");
+ db_unset(si->hContact, CHAT_MODULE, "PopupMask");
}
else {
- db_set_dw(si->hContact, "Chat", "PopupFlags", iFlags);
- db_set_dw(si->hContact, "Chat", "PopupMask", dwMask);
+ db_set_dw(si->hContact, CHAT_MODULE, "PopupFlags", iFlags);
+ db_set_dw(si->hContact, CHAT_MODULE, "PopupMask", dwMask);
}
}
@@ -1184,12 +1184,12 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP if (si) {
if (dwMask == 0) {
- db_unset(si->hContact, "Chat", "TrayIconFlags");
- db_unset(si->hContact, "Chat", "TrayIconMask");
+ db_unset(si->hContact, CHAT_MODULE, "TrayIconFlags");
+ db_unset(si->hContact, CHAT_MODULE, "TrayIconMask");
}
else {
- db_set_dw(si->hContact, "Chat", "TrayIconFlags", iFlags);
- db_set_dw(si->hContact, "Chat", "TrayIconMask", dwMask);
+ db_set_dw(si->hContact, CHAT_MODULE, "TrayIconFlags", iFlags);
+ db_set_dw(si->hContact, CHAT_MODULE, "TrayIconMask", dwMask);
}
Chat_SetFilters(si);
SendMessage(si->hWnd, GC_CHANGEFILTERFLAG, 0, (LPARAM)iFlags);
@@ -1221,7 +1221,7 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L HWND hColor = GetDlgItem(hwndParent, IDC_COLOR);
HWND hBGColor = GetDlgItem(hwndParent, IDC_BKGCOLOR);
- if (M.GetByte("Chat", "RightClickFilter", 0) != 0) {
+ if (M.GetByte(CHAT_MODULE, "RightClickFilter", 0) != 0) {
if (hFilter == hwnd)
SendMessage(hwndParent, GC_SHOWFILTERMENU, 0, 0);
if (hColor == hwnd)
@@ -1865,7 +1865,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!dat->pContainer->settings->fPrivate)
si->iSplitterY = g_Settings.iSplitterY;
else {
- if (M.GetByte("Chat", "SyncSplitter", 0))
+ if (M.GetByte(CHAT_MODULE, "SyncSplitter", 0))
si->iSplitterY = dat->pContainer->settings->splitterPos - DPISCALEY_S(23);
else
si->iSplitterY = g_Settings.iSplitterY;
@@ -2395,7 +2395,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar goto LABEL_SHOWWINDOW;
case SESSION_INITDONE:
- if (M.GetByte("Chat", "PopupOnJoin", 0) != 0)
+ if (M.GetByte(CHAT_MODULE, "PopupOnJoin", 0) != 0)
return TRUE;
// fall through
case WINDOW_VISIBLE:
@@ -3077,13 +3077,13 @@ LABEL_SHOWWINDOW: SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONSETOVERLAYICON,
(LPARAM)(si->bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
- if (si->bFilterEnabled && M.GetByte("Chat", "RightClickFilter", 0) == 0) {
+ if (si->bFilterEnabled && M.GetByte(CHAT_MODULE, "RightClickFilter", 0) == 0) {
SendMessage(hwndDlg, GC_SHOWFILTERMENU, 0, 0);
break;
}
SendMessage(hwndDlg, GC_REDRAWLOG, 0, 0);
SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0);
- db_set_b(si->hContact, "Chat", "FilterEnabled", (BYTE)si->bFilterEnabled);
+ db_set_b(si->hContact, CHAT_MODULE, "FilterEnabled", (BYTE)si->bFilterEnabled);
break;
case IDC_BKGCOLOR:
@@ -3094,7 +3094,7 @@ LABEL_SHOWWINDOW: break;
if (IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR)) {
- if (M.GetByte("Chat", "RightClickFilter", 0) == 0)
+ if (M.GetByte(CHAT_MODULE, "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_BKGCOLOR);
else if (si->bBGSet) {
cf.dwMask = CFM_BACKCOLOR;
@@ -3117,7 +3117,7 @@ LABEL_SHOWWINDOW: break;
if (IsDlgButtonChecked(hwndDlg, IDC_COLOR)) {
- if (M.GetByte("Chat", "RightClickFilter", 0) == 0)
+ if (M.GetByte(CHAT_MODULE, "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_COLOR);
else if (si->bFGSet) {
cf.dwMask = CFM_COLOR;
@@ -3546,10 +3546,10 @@ LABEL_SHOWWINDOW: TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING, 0);
if (!dat->bIsAutosizingInput)
- db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, CHAT_MODULE, "SplitterX", (WORD)g_Settings.iSplitterX);
if (dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
- db_set_w(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
+ db_set_w(NULL, CHAT_MODULE, "splitY", (WORD)g_Settings.iSplitterY);
DM_FreeTheme(dat);
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 92499a98ee..ed244ccd1a 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -374,13 +374,13 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa }
}
- db_set_b(0, "Chat", "PopupStyle", (BYTE)g_Settings.iPopupStyle);
- db_set_w(NULL, "Chat", "PopupTimeout", g_Settings.iPopupTimeout);
+ db_set_b(0, CHAT_MODULE, "PopupStyle", (BYTE)g_Settings.iPopupStyle);
+ db_set_w(NULL, CHAT_MODULE, "PopupTimeout", g_Settings.iPopupTimeout);
g_Settings.crPUBkgColour = SendDlgItemMessage(hWnd, IDC_COLBACK_MUC, CPM_GETCOLOUR, 0, 0);
- db_set_dw(0, "Chat", "PopupColorBG", (DWORD)g_Settings.crPUBkgColour);
+ db_set_dw(0, CHAT_MODULE, "PopupColorBG", (DWORD)g_Settings.crPUBkgColour);
g_Settings.crPUTextColour = SendDlgItemMessage(hWnd, IDC_COLTEXT_MUC, CPM_GETCOLOUR, 0, 0);
- db_set_dw(0, "Chat", "PopupColorText", (DWORD)g_Settings.crPUTextColour);
+ db_set_dw(0, CHAT_MODULE, "PopupColorText", (DWORD)g_Settings.crPUTextColour);
NEN_WriteOptions(&nen_options);
CheckForRemoveMask();
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index a2bf75563f..a88a9d6e19 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -210,7 +210,7 @@ void CGlobals::reloadSettings(bool fReloadSkins) 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_MUCpanelHeight = M.GetDword(CHAT_MODULE, "panelheight", CInfoPanel::DEGRADE_THRESHOLD);
m_IdleDetect = M.GetByte("dimIconsForIdleContacts", 1);
m_smcxicon = 16;
m_smcyicon = 16;
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 91b565cc67..5b11efa34e 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -127,7 +127,7 @@ void CInfoPanel::saveHeight(bool fFlush) PluginConfig.m_MUCpanelHeight = m_height;
m_defaultMUCHeight = m_height;
if (fFlush)
- db_set_dw(0, "Chat", "panelheight", m_height);
+ db_set_dw(0, CHAT_MODULE, "panelheight", m_height);
}
}
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index ff28e11217..2d5d635a3a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -976,7 +976,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case ID_SPLITTERCONTEXT_SAVEGLOBALFORALLSESSIONS:
{
RECT rcWin;
- BYTE bSync = M.GetByte("Chat", "SyncSplitter", 0);
+ BYTE bSync = M.GetByte(CHAT_MODULE, "SyncSplitter", 0);
DWORD dwOff_IM = 0, dwOff_CHAT = 0;
dwOff_CHAT = -(2 + (PluginConfig.g_DPIscaleY > 1.0 ? 1 : 0));
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 7baa7be4ce..90d7ecbca1 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -714,7 +714,6 @@ private: #define SRMSGDEFSET_LOADTIME 10
#define SRMSGSET_BKGCOLOUR "BkgColour"
-#define SRMSGSET_BKGCOLOUR_MUC "BkgColourMUC"
#define SRMSGDEFSET_BKGCOLOUR RGB(250,250,250)
//#define SRMSGDEFSET_BKGCOLOUR GetSysColor(COLOR_WINDOW)
@@ -754,7 +753,6 @@ private: #define SRMSGMOD_T "Tab_SRMsg"
#define FONTMODULE "TabSRMM_Fonts"
#define CHAT_OLDFONTMODULE "TabSRMM_chat_Fonts"
-#define CHAT_FONTMODULE "ChatFonts"
#define IDM_STAYONTOP (WM_USER + 1)
#define IDM_NOTITLE (WM_USER + 2)
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 4a610c3b27..301a031f21 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -48,7 +48,7 @@ static struct _tagExtSettings { "Message Log", "InputBG", FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR,
"Message Log", "HgridColor", FONTMODULE, "hgrid", SRMSGDEFSET_BKGCOLOUR,
"Message Log", "DWFlags", SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT,
- "Chat", "UserListBG", "Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR,
+ CHAT_MODULE, "UserListBG", CHAT_MODULE, "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR,
"Message Log", "LeftIndent", SRMSGMOD_T, "IndentAmount", 20,
"Message Log", "RightIndent", SRMSGMOD_T, "RightIndent", 20,
};
@@ -57,33 +57,36 @@ static struct _tagExtSettings { * new in TabSRMM3 / theme version 5
* don't read these values from themes with version < 5
*/
-static struct _tagExtSettings_v5 {
+struct
+{
char* szIniSection;
char* szIniName;
char* szDbModule;
char* szDbSetting;
DWORD dwDef;
-} _extSettings_v5[18] = {
- "CommonClrs", "IP_High", FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0,
- "CommonClrs", "IP_Low", FONTMODULE, "ipfieldsbg", 0x62caff,
- "CommonClrs", "TB_High", FONTMODULE, "tbBgHigh", 0,
- "CommonClrs", "TB_Low", FONTMODULE, "tbBgLow", 0,
- "CommonClrs", "FillColor", FONTMODULE, "fillColor", 0,
- "CommonClrs", "RichBorders", FONTMODULE, "cRichBorders", 0,
- "CommonClrs", "GenericTxt", FONTMODULE, "genericTxtClr", RGB(20, 20, 20),
- "AeroMode", "Style", SRMSGMOD_T, "aerostyle", CSkin::AERO_EFFECT_MILK,
- "AeroMode", "AeroGlowColor", FONTMODULE, "aeroGlow", RGB(40, 40, 255),
-
- "Colored Tabs", "NormalText", SRMSGMOD_T, "tab_txt_normal", RGB(1, 1, 1),
- "Colored Tabs", "ActiveText", SRMSGMOD_T, "tab_txt_active", RGB(1, 1, 1),
- "Colored Tabs", "HottrackText", SRMSGMOD_T, "tab_txt_hottrack", RGB(1, 1, 1),
- "Colored Tabs", "UnreadText", SRMSGMOD_T, "tab_txt_unread", RGB(1, 1, 1),
-
- "Colored Tabs", "NormalBG", SRMSGMOD_T, "tab_bg_normal", 0xf0f0f0,
- "Colored Tabs", "ActiveBG", SRMSGMOD_T, "tab_bg_active", 0xf0f0f0,
- "Colored Tabs", "HottrackBG", SRMSGMOD_T, "tab_bg_hottrack", 0xf0f0f0,
- "Colored Tabs", "UnreadBG", SRMSGMOD_T, "tab_bg_unread", 0xf0f0f0,
- "Chat", "Background", FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR
+}
+static _extSettings_v5[18] =
+{
+ { "CommonClrs", "IP_High", FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0 },
+ { "CommonClrs", "IP_Low", FONTMODULE, "ipfieldsbg", 0x62caff },
+ { "CommonClrs", "TB_High", FONTMODULE, "tbBgHigh", 0 },
+ { "CommonClrs", "TB_Low", FONTMODULE, "tbBgLow", 0 },
+ { "CommonClrs", "FillColor", FONTMODULE, "fillColor", 0 },
+ { "CommonClrs", "RichBorders", FONTMODULE, "cRichBorders", 0 },
+ { "CommonClrs", "GenericTxt", FONTMODULE, "genericTxtClr", RGB(20, 20, 20) },
+ { "AeroMode", "Style", SRMSGMOD_T, "aerostyle", CSkin::AERO_EFFECT_MILK },
+ { "AeroMode", "AeroGlowColor", FONTMODULE, "aeroGlow", RGB(40, 40, 255) },
+
+ { "Colored Tabs", "NormalText", SRMSGMOD_T, "tab_txt_normal", RGB(1, 1, 1) },
+ { "Colored Tabs", "ActiveText", SRMSGMOD_T, "tab_txt_active", RGB(1, 1, 1) },
+ { "Colored Tabs", "HottrackText", SRMSGMOD_T, "tab_txt_hottrack", RGB(1, 1, 1) },
+ { "Colored Tabs", "UnreadText", SRMSGMOD_T, "tab_txt_unread", RGB(1, 1, 1) },
+
+ { "Colored Tabs", "NormalBG", SRMSGMOD_T, "tab_bg_normal", 0xf0f0f0 },
+ { "Colored Tabs", "ActiveBG", SRMSGMOD_T, "tab_bg_active", 0xf0f0f0 },
+ { "Colored Tabs", "HottrackBG", SRMSGMOD_T, "tab_bg_hottrack", 0xf0f0f0 },
+ { "Colored Tabs", "UnreadBG", SRMSGMOD_T, "tab_bg_unread", 0xf0f0f0 },
+ { CHAT_MODULE, "Background", CHAT_MODULE, "ColorLogBG", SRMSGDEFSET_BKGCOLOUR }
};
/*
@@ -159,7 +162,7 @@ static struct _tagFontBlocks { } fontBlocks[] = {
FONTMODULE, 0, MSGDLGFONTCOUNT, "Font%d", "StdFonts",
FONTMODULE, 100, IPFONTCOUNT, "IPFont%d", "MiscFonts",
- CHAT_FONTMODULE, 0, CHATFONTCOUNT, "ChatFont%d", "ChatFonts",
+ CHATFONT_MODULE, 0, CHATFONTCOUNT, "ChatFont%d", CHATFONT_MODULE,
NULL, 0, 0, NULL
};
@@ -345,7 +348,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in defclr = g_Settings.UserListColors[CHAT_STATUS_NORMAL];
g_Settings.nickColors[i] = GetPrivateProfileIntA("Nick Colors", _itoa(i, szTemp, 10), defclr, szIniFilename);
mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
- db_set_dw(0, "Chat", szTemp, g_Settings.nickColors[i]);
+ db_set_dw(0, CHAT_MODULE, szTemp, g_Settings.nickColors[i]);
}
}
} else {
|