From ab51786ccf2e10217fe25c2dae5de1b2609e76cf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 14 Jan 2014 22:55:55 +0000 Subject: fix for the options reading git-svn-id: http://svn.miranda-ng.org/main/trunk@7660 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdchat/src/chat.h | 42 +++++++++++++++++++-------------------- src/core/stdchat/src/services.cpp | 2 +- src/core/stdchat/src/tools.cpp | 4 ++-- src/core/stdchat/src/window.cpp | 2 +- src/modules/chat/chat_opts.cpp | 3 +++ 5 files changed, 28 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/core/stdchat/src/chat.h b/src/core/stdchat/src/chat.h index f22487dabd..da522f8b67 100644 --- a/src/core/stdchat/src/chat.h +++ b/src/core/stdchat/src/chat.h @@ -128,36 +128,36 @@ void LoadLogIcons(void); //colorchooser.c INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -//log.c -void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw, BOOL bPhaseTwo); -void ValidateFilename (TCHAR * filename); +// log.c +void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw, BOOL bPhaseTwo); +void ValidateFilename (TCHAR * filename); TCHAR* MakeTimeStamp(TCHAR* pszStamp, time_t time); -char* Log_CreateRtfHeader(MODULEINFO * mi); +char* Log_CreateRtfHeader(MODULEINFO * mi); -//window.c +// window.c INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth); -//options.c -int OptionsInit(void); -int OptionsUnInit(void); -void AddIcons(void); -HICON LoadIconEx(char* pszIcoLibName, BOOL big); +// options.c +int OptionsInit(void); +int OptionsUnInit(void); +void AddIcons(void); +HICON LoadIconEx(char* pszIcoLibName, BOOL big); // services.c -void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground); -//tools.c -int GetColorIndex(const char* pszModule, COLORREF cr); -void CheckColorsInModule(const char* pszModule); -int GetRichTextLength(HWND hwnd); -UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText); -void DestroyGCMenu(HMENU *hMenu, int iIndex); -BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char* pszModule, int iType, TCHAR* pszUID, TCHAR* pszText, DWORD dwItem); -BOOL DoEventHook(const TCHAR *pszID, const char* pszModule, int iType, const TCHAR* pszUID, const TCHAR* pszText, DWORD dwItem); +void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground); + +// tools.c +int GetColorIndex(const char* pszModule, COLORREF cr); +void CheckColorsInModule(const char* pszModule); +int GetRichTextLength(HWND hwnd); +UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText); +void DestroyGCMenu(HMENU *hMenu, int iIndex); +BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char* pszModule, int iType, TCHAR* pszUID, TCHAR* pszText, DWORD dwItem); // message.c -char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si); -TCHAR* DoRtfToTags( char* pszRtfText, SESSION_INFO *si); +char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si); +TCHAR* DoRtfToTags( char* pszRtfText, SESSION_INFO *si); BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule); BOOL TabM_RemoveAll(void); diff --git a/src/core/stdchat/src/services.cpp b/src/core/stdchat/src/services.cpp index 57d6258128..02b129554c 100644 --- a/src/core/stdchat/src/services.cpp +++ b/src/core/stdchat/src/services.cpp @@ -52,7 +52,7 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground) g_TabSession.lpCurrentCommand = NULL; } - //Do we need to create a tabbed window? + // Do we need to create a tabbed window? if (g_TabSession.hWnd == NULL) g_TabSession.hWnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), NULL, RoomWndProc, (LPARAM)&g_TabSession); diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 4b34b12b30..072bf6f359 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -74,11 +74,11 @@ void CheckColorsInModule(const char* pszModule) UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText) { - GCMENUITEMS gcmi = { 0 }; HMENU hSubMenu = 0; - *hMenu = GetSubMenu(g_hMenu, iIndex); TranslateMenu(*hMenu); + + GCMENUITEMS gcmi = { 0 }; gcmi.pszID = si->ptszID; gcmi.pszModule = si->pszModule; gcmi.pszUID = pszUID; diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index a12be7920c..6987e6b20c 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -2367,7 +2367,7 @@ LABEL_SHOWWINDOW: si->bNicklistEnabled = !si->bNicklistEnabled; - SendDlgItemMessage(hwndDlg,IDC_SHOWNICKLIST,BM_SETIMAGE,IMAGE_ICON,(LPARAM)LoadIconEx( si->bNicklistEnabled ? "nicklist" : "nicklist2", FALSE )); + SendDlgItemMessage(hwndDlg, IDC_SHOWNICKLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(si->bNicklistEnabled ? "nicklist" : "nicklist2", FALSE)); SendMessage(hwndDlg, GC_SCROLLTOBOTTOM, 0, 0); SendMessage(hwndDlg, WM_SIZE, 0, 0); break; diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp index ce73ae8897..eb1dae31ce 100644 --- a/src/modules/chat/chat_opts.cpp +++ b/src/modules/chat/chat_opts.cpp @@ -234,6 +234,9 @@ void LoadGlobalSettings(void) ci.pSettings->ShowContactStatus = db_get_b(NULL, "Chat", "ShowContactStatus", 0); ci.pSettings->ContactStatusFirst = db_get_b(NULL, "Chat", "ContactStatusFirst", 0); + if (ci.OnLoadSettings) + ci.OnLoadSettings(); + InitSetting(&ci.pSettings->pszTimeStamp, "HeaderTime", _T("[%H:%M]")); InitSetting(&ci.pSettings->pszTimeStampLog, "LogTimestamp", _T("[%d %b %y %H:%M]")); InitSetting(&ci.pSettings->pszIncomingNick, "HeaderIncoming", _T("%n:")); -- cgit v1.2.3