From 529c7d557a7dc8693c68c0fb66275e9fe999c0d2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 19 Jan 2014 08:32:55 +0000 Subject: - StdChat-related data removed from core; - fix for displaying icons in chat log; git-svn-id: http://svn.miranda-ng.org/main/trunk@7743 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdchat/src/chat.h | 7 +++---- src/core/stdchat/src/main.cpp | 11 +++++++---- src/core/stdchat/src/options.cpp | 2 +- src/core/stdchat/src/window.cpp | 2 +- src/modules/chat/chat_opts.cpp | 2 -- src/modules/chat/chat_svc.cpp | 2 ++ src/modules/chat/log.cpp | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/core/stdchat/src/chat.h b/src/core/stdchat/src/chat.h index 3c3fb68d4e..c5e3472401 100644 --- a/src/core/stdchat/src/chat.h +++ b/src/core/stdchat/src/chat.h @@ -88,6 +88,7 @@ struct MODULEINFO : public GCModuleInfoBase struct SESSION_INFO : public GCSessionInfoBase { + int iX, iY; IAccPropServices* pAccPropServicesForNickList; }; @@ -95,10 +96,8 @@ struct LOGSTREAMDATA : public GCLogStreamDataBase {}; struct GlobalLogSettings : public GlobalLogSettingsBase { - BOOL TabsEnable; - BOOL TabsAtBottom; - BOOL TabCloseOnDblClick; - BOOL TabRestore; + int iX, iY; + bool TabsEnable, TabsAtBottom, TabCloseOnDblClick, TabRestore; }; extern GlobalLogSettings g_Settings; diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 3d799b1a99..b785eb0e46 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -253,10 +253,13 @@ static BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) static void OnLoadSettings() { - g_Settings.TabsEnable = db_get_b(NULL, "Chat", "Tabs", 1); - g_Settings.TabRestore = db_get_b(NULL, "Chat", "TabRestore", 0); - g_Settings.TabsAtBottom = db_get_b(NULL, "Chat", "TabBottom", 0); - g_Settings.TabCloseOnDblClick = db_get_b(NULL, "Chat", "TabCloseOnDblClick", 0); + g_Settings.iX = db_get_dw(NULL, "Chat", "roomx", -1); + g_Settings.iY = db_get_dw(NULL, "Chat", "roomy", -1); + + g_Settings.TabsEnable = 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; ZeroMemory(&g_TabSession, sizeof(SESSION_INFO)); g_TabSession.iType = GCW_TABROOM; diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp index 987996a1b6..f643253b81 100644 --- a/src/core/stdchat/src/options.cpp +++ b/src/core/stdchat/src/options.cpp @@ -430,7 +430,7 @@ static INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA if (b != db_get_b(NULL, "Chat", "Tabs", 1)) { pci->SM_BroadcastMessage(NULL, GC_CLOSEWINDOW, 0, 1, FALSE); - g_Settings.TabsEnable = db_get_b(NULL, "Chat", "Tabs", 1); + g_Settings.TabsEnable = db_get_b(NULL, "Chat", "Tabs", 1) != 0; } else pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE); diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index cd03088966..d3298ec559 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -1177,7 +1177,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) } // restore previous tabs - if (g_Settings.TabsEnable && db_get_b(NULL, "Chat", "TabRestore", 0)) { + if (g_Settings.TabsEnable && g_Settings.TabRestore) { TABLIST *node = g_TabList; while (node) { SESSION_INFO *s = pci->SM_FindSession(node->pszID, node->pszModule); diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp index d891331f2b..68f4710827 100644 --- a/src/modules/chat/chat_opts.cpp +++ b/src/modules/chat/chat_opts.cpp @@ -306,8 +306,6 @@ int OptionsInit(void) g_Settings->UserListFont = NULL; g_Settings->UserListHeadingsFont = NULL; g_Settings->MessageBoxFont = NULL; - g_Settings->iX = db_get_dw(NULL, "Chat", "roomx", -1); - g_Settings->iY = db_get_dw(NULL, "Chat", "roomy", -1); g_Settings->iWidth = db_get_dw(NULL, "Chat", "roomwidth", -1); g_Settings->iHeight = db_get_dw(NULL, "Chat", "roomheight", -1); diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp index c8735ca7c8..de9e7dc464 100644 --- a/src/modules/chat/chat_svc.cpp +++ b/src/modules/chat/chat_svc.cpp @@ -66,6 +66,8 @@ void LoadChatIcons(void) ci.hIcons[ICON_STATUS3] = LoadIconEx("status3", FALSE); ci.hIcons[ICON_STATUS4] = LoadIconEx("status4", FALSE); ci.hIcons[ICON_STATUS5] = LoadIconEx("status5", FALSE); + + LoadMsgLogBitmaps(); } static int FontsChanged(WPARAM wParam, LPARAM lParam) diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp index 18a95b518b..01e2c2c1ef 100644 --- a/src/modules/chat/log.cpp +++ b/src/modules/chat/log.cpp @@ -346,7 +346,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) Log_Append(&buffer, &bufferEnd, &bufferAlloced, "\\par%s ", Log_SetStyle(0, 0)); // Insert icon - if (lin->iType & g_Settings->dwIconFlags || lin->bIsHighlighted&&g_Settings->dwIconFlags & GC_EVENT_HIGHLIGHT) { + if ((lin->iType & g_Settings->dwIconFlags) || lin->bIsHighlighted && (g_Settings->dwIconFlags & GC_EVENT_HIGHLIGHT)) { int iIndex = (lin->bIsHighlighted && g_Settings->dwIconFlags & GC_EVENT_HIGHLIGHT) ? ICON_HIGHLIGHT : EventToIcon(lin); Log_Append(&buffer, &bufferEnd, &bufferAlloced, "\\f0\\fs14"); while (bufferAlloced - bufferEnd < logIconBmpSize[0]) -- cgit v1.2.3