From f5f971a87df2f6d3e3891c5eaa0ff67935eaa7ad Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Mon, 3 Sep 2012 22:14:59 +0200 Subject: [PATCH] Fixed issue #1381: Sync Dialog log message add colored "success" or "git did not exit cleanly" at the end Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/ProgressDlg.h | 4 ++-- src/TortoiseProc/SyncDlg.cpp | 27 +++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 8fe236d9d..632f95d33 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -19,6 +19,7 @@ Released: unreleased * Fixed issue #1363: copy email in the log window * Fixed issue #1373: The only available remote should be set on PUSH * Fixed issue #1216: Revamp update dialog + * Fixed issue #1381: Sync Dialog log message add colored "success" or "git did not exit cleanly" at the end == Bug Fix == * Fixed issue #1062: Log window should refresh automatically after reset --hard diff --git a/src/TortoiseProc/ProgressDlg.h b/src/TortoiseProc/ProgressDlg.h index 392282483..899a26575 100644 --- a/src/TortoiseProc/ProgressDlg.h +++ b/src/TortoiseProc/ProgressDlg.h @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2008-2011 - TortoiseGit +// Copyright (C) 2008-2012 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -115,9 +115,9 @@ public: static UINT RunCmdList(CWnd *pWnd,std::vector &cmdlist,bool bShowCommand,CString *pfilename,bool *bAbort,CGitByteArray *pdata=NULL); -private: static void InsertColorText(CRichEditCtrl &edit,CString text,COLORREF rgb); +private: afx_msg void OnBnClickedOk(); afx_msg void OnBnClickedButton1(); diff --git a/src/TortoiseProc/SyncDlg.cpp b/src/TortoiseProc/SyncDlg.cpp index b7ec0853f..8b414f63b 100644 --- a/src/TortoiseProc/SyncDlg.cpp +++ b/src/TortoiseProc/SyncDlg.cpp @@ -1053,8 +1053,31 @@ LRESULT CSyncDlg::OnProgressUpdateUI(WPARAM wParam,LPARAM lParam) m_ctrlAnimate.Stop(); m_ctrlProgress.SetPos(100); //this->DialogEnableWindow(IDOK,TRUE); - if (m_pTaskbarList) - m_pTaskbarList->SetProgressState(m_hWnd, TBPF_NOPROGRESS); + + DWORD exitCode = (DWORD)lParam; + if (exitCode) + { + if (m_pTaskbarList) + { + m_pTaskbarList->SetProgressState(m_hWnd, TBPF_ERROR); + m_pTaskbarList->SetProgressValue(m_hWnd, 100, 100); + } + CString log; + log.Format(IDS_PROC_PROGRESS_GITUNCLEANEXIT, exitCode); + CString err; + err.Format(_T("\r\n\r\n%s\r\n"), log); + CProgressDlg::InsertColorText(this->m_ctrlCmdOut, err, RGB(255,0,0)); + } + else + { + if (m_pTaskbarList) + m_pTaskbarList->SetProgressState(m_hWnd, TBPF_NOPROGRESS); + CString temp; + temp.LoadString(IDS_SUCCESS); + CString log; + log.Format(_T("\r\n%s\r\n"), temp); + CProgressDlg::InsertColorText(this->m_ctrlCmdOut, log, RGB(0,0,255)); + } //if(wParam == MSG_PROGRESSDLG_END) if(this->m_CurrentCmd == GIT_COMMAND_PUSH ) -- 2.11.4.GIT