From 7fb3ca3319316ce5188bb8ce972e6ef3dd4353b5 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 16 Dec 2011 02:23:40 +0100 Subject: [PATCH] honor relative dates Signed-off-by: Sven Strickroth --- src/TortoiseGitBlame/TortoiseGitBlameView.cpp | 5 ++++- src/TortoiseGitBlame/TortoiseGitBlameView.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TortoiseGitBlame/TortoiseGitBlameView.cpp b/src/TortoiseGitBlame/TortoiseGitBlameView.cpp index 69c07aafd..8be38134b 100644 --- a/src/TortoiseGitBlame/TortoiseGitBlameView.cpp +++ b/src/TortoiseGitBlame/TortoiseGitBlameView.cpp @@ -141,6 +141,9 @@ CTortoiseGitBlameView::CTortoiseGitBlameView() { m_DateFormat = DATE_LONGDATE; } + // get relative time display setting from registry + DWORD regRelativeTimes = CRegDWORD(_T("Software\\TortoiseGit\\RelativeTimes"), FALSE); + m_bRelativeTimes = (regRelativeTimes != 0); m_sRev.LoadString(IDS_LOG_REVISION); m_sAuthor.LoadString(IDS_LOG_AUTHOR); @@ -2783,7 +2786,7 @@ void CTortoiseGitBlameView::OnMouseHover(UINT nFlags, CPoint point) CString str; str.Format(_T("%s: %s\n%s: %s\n%s: %s\n%s:\n%s\n%s"), m_sRev, pRev->m_CommitHash.ToString(), m_sAuthor, pRev->GetAuthorName(), - m_sDate, CAppUtils::FormatDateAndTime(pRev->GetAuthorDate(), m_DateFormat), + m_sDate, CAppUtils::FormatDateAndTime(pRev->GetAuthorDate(), m_DateFormat, true, m_bRelativeTimes), m_sMessage, pRev->GetSubject(), pRev->GetBody()); diff --git a/src/TortoiseGitBlame/TortoiseGitBlameView.h b/src/TortoiseGitBlame/TortoiseGitBlameView.h index ddb6b9507..a4c86b835 100644 --- a/src/TortoiseGitBlame/TortoiseGitBlameView.h +++ b/src/TortoiseGitBlame/TortoiseGitBlameView.h @@ -285,6 +285,7 @@ protected: char *m_Buffer; DWORD m_DateFormat; // DATE_SHORTDATE or DATE_LONGDATE + bool m_bRelativeTimes; // Show relative times CString m_sRev; CString m_sAuthor; -- 2.11.4.GIT