From 69182b36aaa3e163e1747f06c42d66717bbcd189 Mon Sep 17 00:00:00 2001 From: rainwater Date: Wed, 28 Aug 2002 17:44:47 +0000 Subject: [PATCH] Added warnings to titlebar git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@779 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/makensisw.cpp | 5 ++++- Contrib/Makensisw/utils.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Contrib/Makensisw/makensisw.cpp b/Contrib/Makensisw/makensisw.cpp index 529a752a..dced4635 100644 --- a/Contrib/Makensisw/makensisw.cpp +++ b/Contrib/Makensisw/makensisw.cpp @@ -36,6 +36,7 @@ static int dy; HINSTANCE g_hInstance; HWND g_hwnd; HANDLE g_hThread; +BOOL g_warnings; int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow) { HACCEL haccel; @@ -45,6 +46,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd else while (*g_script++!=' '); while (*g_script==' ') g_script++; g_retcode = -1; // return code is always false unless set to true by GetExitCodeProcess + g_warnings = FALSE; HWND hDialog = CreateDialog(g_hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc); if (!hDialog) { char buf [MAX_STRING]; @@ -135,7 +137,8 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { } if (g_retcode==0) { MessageBeep(MB_ICONASTERISK); - SetTitle(g_hwnd,"Finished Sucessfully"); + if (g_warnings) SetTitle(g_hwnd,"Finished with Warnings"); + else SetTitle(g_hwnd,"Finished Sucessfully"); } else SetTitle(g_hwnd,"Compile Error: See Log for Details"); EnableItems(g_hwnd); diff --git a/Contrib/Makensisw/utils.cpp b/Contrib/Makensisw/utils.cpp index 386974ef..f9674014 100644 --- a/Contrib/Makensisw/utils.cpp +++ b/Contrib/Makensisw/utils.cpp @@ -56,6 +56,8 @@ void ClearLog(HWND hwnd) { char g_output_exe[1024]; char g_input_script[1024]; BOOL g_input_found; +extern BOOL g_warnings; + void LogMessage(HWND hwnd,const char *str) { if (!str || !*str) return; int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0); @@ -77,6 +79,9 @@ void LogMessage(HWND hwnd,const char *str) { g_input_found=TRUE; } } + if (my_strstr(existing_text," warning:")||my_strstr(existing_text," warnings:")) { + g_warnings = TRUE; + } SetDlgItemText(hwnd, IDC_LOGWIN, existing_text); SendDlgItemMessage(hwnd, IDC_LOGWIN,EM_SETSEL,lstrlen(existing_text),lstrlen(existing_text)); SendDlgItemMessage(hwnd, IDC_LOGWIN,EM_SCROLLCARET,0,0);