summaryrefslogtreecommitdiff
path: root/src/modules/chat
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/modules/chat
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/modules/chat')
-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
4 files changed, 51 insertions, 51 deletions
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);