summaryrefslogtreecommitdiff
path: root/src/modules/chat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-17 15:14:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-17 15:14:41 +0000
commit81cc0996f38dca205fe283e24d64df6e9cea7c10 (patch)
tree4c09ebfb8966e30ee84b2f1d8e4f84d5795fb8e0 /src/modules/chat
parentd7d4fc4e61b3b0271a4dac9d04283f5237ed514e (diff)
- icons management also moved to core;
- forced ReloadSettings() after initialization git-svn-id: http://svn.miranda-ng.org/main/trunk@7690 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat')
-rw-r--r--src/modules/chat/chat.h1
-rw-r--r--src/modules/chat/chat_opts.cpp8
-rw-r--r--src/modules/chat/chat_svc.cpp26
-rw-r--r--src/modules/chat/manager.cpp2
4 files changed, 32 insertions, 5 deletions
diff --git a/src/modules/chat/chat.h b/src/modules/chat/chat.h
index 74855f1785..f4027e4e6b 100644
--- a/src/modules/chat/chat.h
+++ b/src/modules/chat/chat.h
@@ -73,6 +73,7 @@ void SetIndentSize(void);
void RegisterFonts(void);
// services.c
+void LoadChatIcons(void);
int LoadChatModule(void);
void UnloadChatModule(void);
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index 6917d0be6f..45f179e99b 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -288,6 +288,9 @@ void LoadGlobalSettings(void)
LoadMsgDlgFont(19, &lf, NULL);
g_Settings->UserListHeadingsFont = CreateFontIndirect(&lf);
+ if (g_Settings->LoggingEnabled)
+ CreateDirectoryTreeT(g_Settings->pszLogDir);
+
SetIndentSize();
}
@@ -361,8 +364,6 @@ int OptionsInit(void)
if (g_Settings->iSplitterY <= 65)
g_Settings->iSplitterY = 90;
- LoadGlobalSettings();
-
SkinAddNewSoundEx("ChatMessage", LPGEN("Group chats"), LPGEN("Incoming message"));
SkinAddNewSoundEx("ChatHighlight", LPGEN("Group chats"), LPGEN("Message is highlighted"));
SkinAddNewSoundEx("ChatAction", LPGEN("Group chats"), LPGEN("User has performed an action"));
@@ -374,9 +375,6 @@ int OptionsInit(void)
SkinAddNewSoundEx("ChatNotice", LPGEN("Group chats"), LPGEN("User has sent a notice"));
SkinAddNewSoundEx("ChatQuit", LPGEN("Group chats"), LPGEN("User has disconnected"));
SkinAddNewSoundEx("ChatTopic", LPGEN("Group chats"), LPGEN("The topic has been changed"));
-
- if (g_Settings->LoggingEnabled)
- CreateDirectoryTreeT(g_Settings->pszLogDir);
return 0;
}
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index 5bbd5caeba..a04bfa861a 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -44,6 +44,30 @@ static HANDLE
/////////////////////////////////////////////////////////////////////////////////////////
// Post-load event hooks
+void LoadChatIcons(void)
+{
+ ci.hIcons[ICON_ACTION] = LoadIconEx("log_action", FALSE);
+ ci.hIcons[ICON_ADDSTATUS] = LoadIconEx("log_addstatus", FALSE);
+ ci.hIcons[ICON_HIGHLIGHT] = LoadIconEx("log_highlight", FALSE);
+ ci.hIcons[ICON_INFO] = LoadIconEx("log_info", FALSE);
+ ci.hIcons[ICON_JOIN] = LoadIconEx("log_join", FALSE);
+ ci.hIcons[ICON_KICK] = LoadIconEx("log_kick", FALSE);
+ ci.hIcons[ICON_MESSAGE] = LoadIconEx("log_message_in", FALSE);
+ ci.hIcons[ICON_MESSAGEOUT] = LoadIconEx("log_message_out", FALSE);
+ ci.hIcons[ICON_NICK] = LoadIconEx("log_nick", FALSE);
+ ci.hIcons[ICON_NOTICE] = LoadIconEx("log_notice", FALSE);
+ ci.hIcons[ICON_PART] = LoadIconEx("log_part", FALSE);
+ ci.hIcons[ICON_QUIT] = LoadIconEx("log_quit", FALSE);
+ ci.hIcons[ICON_REMSTATUS] = LoadIconEx("log_removestatus", FALSE);
+ ci.hIcons[ICON_TOPIC] = LoadIconEx("log_topic", FALSE);
+ ci.hIcons[ICON_STATUS0] = LoadIconEx("status0", FALSE);
+ ci.hIcons[ICON_STATUS1] = LoadIconEx("status1", FALSE);
+ ci.hIcons[ICON_STATUS2] = LoadIconEx("status2", FALSE);
+ ci.hIcons[ICON_STATUS3] = LoadIconEx("status3", FALSE);
+ ci.hIcons[ICON_STATUS4] = LoadIconEx("status4", FALSE);
+ ci.hIcons[ICON_STATUS5] = LoadIconEx("status5", FALSE);
+}
+
static int FontsChanged(WPARAM wParam, LPARAM lParam)
{
LoadLogFonts();
@@ -59,6 +83,8 @@ static int FontsChanged(WPARAM wParam, LPARAM lParam)
static int IconsChanged(WPARAM wParam, LPARAM lParam)
{
+ LoadChatIcons();
+
FreeMsgLogBitmaps();
LoadMsgLogBitmaps();
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index ac110f3429..60ceb2181d 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -1487,6 +1487,8 @@ INT_PTR SvcGetChatManager(WPARAM, LPARAM lParam)
g_szFontGroup = pInit->szFontGroup;
g_cbSession = pInit->cbSession;
g_cbModuleInfo = pInit->cbModuleInfo;
+
+ LoadChatIcons();
RegisterFonts();
OptionsInit();
return (INT_PTR)&ci;