1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - TortoiseSVN
4 // Copyright (C) 2008-2013 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "TortoiseProc.h"
23 #include "StatGraphDlg.h"
25 #include "MessageBox.h"
28 #include "PathUtils.h"
29 #include "StringUtils.h"
30 #include "UnicodeUtils.h"
33 #include "BrowseRefsDlg.h"
34 #include "SmartHandle.h"
35 #include "LogOrdering.h"
37 IMPLEMENT_DYNAMIC(CLogDlg
, CResizableStandAloneDialog
)
38 CLogDlg::CLogDlg(CWnd
* pParent
/*=NULL*/)
39 : CResizableStandAloneDialog(CLogDlg::IDD
, pParent
)
41 , m_currentChangedArray(NULL
)
43 , m_bFollowRenames(FALSE
)
45 , m_bSelectionMustBeSingle(true)
48 , m_bSelectionMustBeContinuous(false)
53 , m_pNotifyWindow(NULL
)
60 m_bFilterWithRegex
= !!CRegDWORD(_T("Software\\TortoiseGit\\UseRegexFilter"), TRUE
);
63 str
=g_Git
.m_CurrentDir
;
64 str
.Replace(_T(":"),_T("_"));
65 str
=CString(_T("Software\\TortoiseGit\\LogDialog\\AllBranch\\"))+str
;
67 m_regbAllBranch
=CRegDWORD(str
,FALSE
);
69 m_bAllBranch
=m_regbAllBranch
;
71 str
= g_Git
.m_CurrentDir
;
72 str
.Replace(_T(":"),_T("_"));
73 str
= CString(_T("Software\\TortoiseGit\\LogDialog\\ShowTags\\")) + str
;
74 m_regbShowTags
= CRegDWORD(str
, TRUE
);
75 m_bShowTags
= m_regbShowTags
;
78 m_bWholeProject
=FALSE
;
80 m_bShowUnversioned
= CRegDWORD(_T("Software\\TortoiseGit\\AddBeforeCommit"), TRUE
);
86 m_regbAllBranch
=m_bAllBranch
;
87 m_regbShowTags
= m_bShowTags
;
89 m_CurrentFilteredChangedArray
.RemoveAll();
93 void CLogDlg::DoDataExchange(CDataExchange
* pDX
)
95 CResizableStandAloneDialog::DoDataExchange(pDX
);
96 DDX_Control(pDX
, IDC_LOGLIST
, m_LogList
);
97 DDX_Control(pDX
, IDC_LOGMSG
, m_ChangedFileListCtrl
);
98 DDX_Control(pDX
, IDC_PROGRESS
, m_LogProgress
);
99 DDX_Control(pDX
, IDC_SPLITTERTOP
, m_wndSplitter1
);
100 DDX_Control(pDX
, IDC_SPLITTERBOTTOM
, m_wndSplitter2
);
101 DDX_Text(pDX
, IDC_SEARCHEDIT
, m_LogList
.m_sFilterText
);
102 DDX_Control(pDX
, IDC_DATEFROM
, m_DateFrom
);
103 DDX_Control(pDX
, IDC_DATETO
, m_DateTo
);
104 DDX_Control(pDX
, IDC_LOG_JUMPTYPE
, m_JumpType
);
105 DDX_Control(pDX
, IDC_LOG_JUMPUP
, m_JumpUp
);
106 DDX_Control(pDX
, IDC_LOG_JUMPDOWN
, m_JumpDown
);
107 DDX_Control(pDX
, IDC_HIDEPATHS
, m_cHidePaths
);
108 DDX_Text(pDX
, IDC_LOGINFO
, m_sLogInfo
);
109 DDX_Check(pDX
, IDC_LOG_FIRSTPARENT
, m_bFirstParent
);
110 DDX_Check(pDX
, IDC_LOG_ALLBRANCH
,m_bAllBranch
);
111 DDX_Check(pDX
, IDC_LOG_FOLLOWRENAMES
, m_bFollowRenames
);
112 DDX_Check(pDX
, IDC_SHOWWHOLEPROJECT
,m_bWholeProject
);
113 DDX_Check(pDX
, IDC_LOG_SHOWTAGS
, m_bShowTags
);
114 DDX_Control(pDX
, IDC_SEARCHEDIT
, m_cFilter
);
115 DDX_Control(pDX
, IDC_STATIC_REF
, m_staticRef
);
116 DDX_Control(pDX
, IDC_PIC_AUTHOR
, m_gravatar
);
119 BEGIN_MESSAGE_MAP(CLogDlg
, CResizableStandAloneDialog
)
122 ON_NOTIFY(LVN_ITEMCHANGED
, IDC_LOGLIST
, OnLvnItemchangedLoglist
)
123 ON_NOTIFY(LVN_ITEMCHANGED
, IDC_LOGMSG
, OnLvnItemchangedLogmsg
)
124 ON_NOTIFY(EN_LINK
, IDC_MSGVIEW
, OnEnLinkMsgview
)
125 ON_BN_CLICKED(IDC_STATBUTTON
, OnBnClickedStatbutton
)
127 ON_MESSAGE(WM_FILTEREDIT_INFOCLICKED
, OnClickedInfoIcon
)
128 ON_MESSAGE(WM_FILTEREDIT_CANCELCLICKED
, OnClickedCancelFilter
)
130 ON_MESSAGE(MSG_LOAD_PERCENTAGE
,OnLogListLoading
)
132 ON_EN_CHANGE(IDC_SEARCHEDIT
, OnEnChangeSearchedit
)
134 ON_NOTIFY(DTN_DATETIMECHANGE
, IDC_DATETO
, OnDtnDatetimechangeDateto
)
135 ON_NOTIFY(DTN_DATETIMECHANGE
, IDC_DATEFROM
, OnDtnDatetimechangeDatefrom
)
136 ON_CBN_SELCHANGE(IDC_LOG_JUMPTYPE
, &CLogDlg::OnCbnSelchangeJumpType
)
137 ON_COMMAND(IDC_LOG_JUMPUP
, &CLogDlg::OnBnClickedJumpUp
)
138 ON_COMMAND(IDC_LOG_JUMPDOWN
, &CLogDlg::OnBnClickedJumpDown
)
139 ON_BN_CLICKED(IDC_SHOWWHOLEPROJECT
, OnBnClickShowWholeProject
)
140 ON_NOTIFY(LVN_COLUMNCLICK
,IDC_LOGLIST
, OnLvnColumnclick
)
141 ON_BN_CLICKED(IDC_HIDEPATHS
, OnBnClickedHidepaths
)
142 ON_COMMAND(MSG_FETCHED_DIFF
, OnBnClickedHidepaths
)
143 ON_BN_CLICKED(IDC_LOG_ALLBRANCH
, OnBnClickedAllBranch
)
144 ON_BN_CLICKED(IDC_LOG_FOLLOWRENAMES
, OnBnClickedFollowRenames
)
145 ON_BN_CLICKED(IDC_LOG_SHOWTAGS
, OnBnClickedShowTags
)
147 ON_NOTIFY(DTN_DROPDOWN
, IDC_DATEFROM
, &CLogDlg::OnDtnDropdownDatefrom
)
148 ON_NOTIFY(DTN_DROPDOWN
, IDC_DATETO
, &CLogDlg::OnDtnDropdownDateto
)
150 ON_BN_CLICKED(IDC_LOG_FIRSTPARENT
, &CLogDlg::OnBnClickedFirstParent
)
151 ON_BN_CLICKED(IDC_REFRESH
, &CLogDlg::OnBnClickedRefresh
)
152 ON_STN_CLICKED(IDC_STATIC_REF
, &CLogDlg::OnBnClickedBrowseRef
)
153 ON_COMMAND(ID_LOGDLG_REFRESH
, &CLogDlg::OnBnClickedRefresh
)
154 ON_COMMAND(ID_LOGDLG_FIND
, &CLogDlg::OnFind
)
155 ON_COMMAND(ID_LOGDLG_FOCUSFILTER
, &CLogDlg::OnFocusFilter
)
156 ON_COMMAND(ID_EDIT_COPY
, &CLogDlg::OnEditCopy
)
157 ON_MESSAGE(MSG_REFLOG_CHANGED
, OnRefLogChanged
)
158 ON_REGISTERED_MESSAGE(WM_TASKBARBTNCREATED
, OnTaskbarBtnCreated
)
163 JumpType_AuthorEmail
,
164 JumpType_CommitterEmail
,
172 void CLogDlg::SetParams(const CTGitPath
& orgPath
, const CTGitPath
& path
, CString hightlightRevision
, CString range
, int limit
)
176 m_hightlightRevision
= hightlightRevision
;
178 if (!(range
.IsEmpty() || range
== _T("HEAD")))
179 m_bAllBranch
= false;
184 if (::IsWindow(m_hWnd
))
188 void CLogDlg::SetFilter(const CString
& findstr
, LONG findtype
, bool findregex
)
190 m_LogList
.m_sFilterText
= findstr
;
192 m_LogList
.m_SelectedFilters
= findtype
;
193 m_LogList
.m_bFilterWithRegex
= m_bFilterWithRegex
= findregex
;
196 BOOL
CLogDlg::OnInitDialog()
199 CResizableStandAloneDialog::OnInitDialog();
200 CAppUtils::MarkWindowAsUnpinnable(m_hWnd
);
202 // Let the TaskbarButtonCreated message through the UIPI filter. If we don't
203 // do this, Explorer would be unable to send that message to our window if we
204 // were running elevated. It's OK to make the call all the time, since if we're
205 // not elevated, this is a no-op.
206 CHANGEFILTERSTRUCT cfs
= { sizeof(CHANGEFILTERSTRUCT
) };
207 typedef BOOL STDAPICALLTYPE
ChangeWindowMessageFilterExDFN(HWND hWnd
, UINT message
, DWORD action
, PCHANGEFILTERSTRUCT pChangeFilterStruct
);
208 CAutoLibrary hUser
= AtlLoadSystemLibraryUsingFullPath(_T("user32.dll"));
211 ChangeWindowMessageFilterExDFN
*pfnChangeWindowMessageFilterEx
= (ChangeWindowMessageFilterExDFN
*)GetProcAddress(hUser
, "ChangeWindowMessageFilterEx");
212 if (pfnChangeWindowMessageFilterEx
)
214 pfnChangeWindowMessageFilterEx(m_hWnd
, WM_TASKBARBTNCREATED
, MSGFLT_ALLOW
, &cfs
);
217 m_pTaskbarList
.Release();
218 if (FAILED(m_pTaskbarList
.CoCreateInstance(CLSID_TaskbarList
)))
219 m_pTaskbarList
= nullptr;
221 m_hAccel
= LoadAccelerators(AfxGetResourceHandle(),MAKEINTRESOURCE(IDR_ACC_LOGDLG
));
223 // use the state of the "stop on copy/rename" option from the last time
226 // set the font to use in the log message view, configured in the settings dialog
227 CAppUtils::CreateFontForLogs(m_logFont
);
228 GetDlgItem(IDC_MSGVIEW
)->SetFont(&m_logFont
);
229 // automatically detect URLs in the log message and turn them into links
230 GetDlgItem(IDC_MSGVIEW
)->SendMessage(EM_AUTOURLDETECT
, TRUE
, NULL
);
231 // make the log message rich edit control send a message when the mouse pointer is over a link
232 GetDlgItem(IDC_MSGVIEW
)->SendMessage(EM_SETEVENTMASK
, NULL
, ENM_LINK
);
233 //m_LogList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_SUBITEMIMAGES);
235 // the "hide unrelated paths" checkbox should be indeterminate
236 m_cHidePaths
.SetCheck(BST_INDETERMINATE
);
239 //SetWindowTheme(m_LogList.GetSafeHwnd(), L"Explorer", NULL);
240 //SetWindowTheme(m_ChangedFileListCtrl.GetSafeHwnd(), L"Explorer", NULL);
242 // set up the columns
243 m_LogList
.DeleteAllItems();
245 m_LogList
.m_Path
=m_path
;
246 m_LogList
.m_hasWC
= m_LogList
.m_bShowWC
= !g_GitAdminDir
.IsBareRepo(g_Git
.m_CurrentDir
);
247 m_LogList
.InsertGitColumn();
249 m_ChangedFileListCtrl
.Init(GITSLC_COLEXT
| GITSLC_COLSTATUS
|GITSLC_COLADD
|GITSLC_COLDEL
, _T("LogDlg"), (GITSLC_POPALL
^ (GITSLC_POPCOMMIT
|GITSLC_POPIGNORE
|GITSLC_POPRESTORE
)), false, m_LogList
.m_hasWC
, GITSLC_COLEXT
| GITSLC_COLSTATUS
| GITSLC_COLADD
| GITSLC_COLDEL
);
251 GetDlgItem(IDC_LOGLIST
)->UpdateData(FALSE
);
255 m_tooltips
.Create(this);
256 CheckRegexpTooltip();
260 // the filter control has a 'cancel' button (the red 'X'), we need to load its bitmap
261 m_cFilter
.SetCancelBitmaps(IDI_CANCELNORMAL
, IDI_CANCELPRESSED
);
262 m_cFilter
.SetInfoIcon(IDI_LOGFILTER
);
263 m_cFilter
.SetValidator(this);
265 AdjustControlSize(IDC_HIDEPATHS
);
266 AdjustControlSize(IDC_LOG_FIRSTPARENT
);
267 AdjustControlSize(IDC_LOG_ALLBRANCH
);
268 AdjustControlSize(IDC_SHOWWHOLEPROJECT
);
269 AdjustControlSize(IDC_LOG_FOLLOWRENAMES
);
270 AdjustControlSize(IDC_LOG_SHOWTAGS
);
272 if (m_gravatar
.IsGravatarEnabled())
275 GetDlgItem(IDC_MSGVIEW
)->GetWindowRect(&rect
);
276 ScreenToClient(&rect
);
277 m_gravatar
.GetWindowRect(&rect2
);
278 ScreenToClient(&rect2
);
279 rect
.right
= rect2
.left
;
280 GetDlgItem(IDC_MSGVIEW
)->MoveWindow(&rect
);
283 m_gravatar
.ShowWindow(SW_HIDE
);
285 GetClientRect(m_DlgOrigRect
);
286 m_LogList
.GetClientRect(m_LogListOrigRect
);
287 GetDlgItem(IDC_MSGVIEW
)->GetClientRect(m_MsgViewOrigRect
);
288 m_ChangedFileListCtrl
.GetClientRect(m_ChgOrigRect
);
290 m_DateFrom
.SendMessage(DTM_SETMCSTYLE
, 0, MCS_WEEKNUMBERS
|MCS_NOTODAY
|MCS_NOTRAILINGDATES
|MCS_NOSELCHANGEONNAV
);
291 m_DateTo
.SendMessage(DTM_SETMCSTYLE
, 0, MCS_WEEKNUMBERS
|MCS_NOTODAY
|MCS_NOTRAILINGDATES
|MCS_NOSELCHANGEONNAV
);
293 m_staticRef
.SetURL(CString());
296 AddAnchor(IDC_STATIC_REF
, TOP_LEFT
);
297 //AddAnchor(IDC_BUTTON_BROWSE_REF, TOP_LEFT);
298 AddAnchor(IDC_FROMLABEL
, TOP_LEFT
);
299 AddAnchor(IDC_DATEFROM
, TOP_LEFT
);
300 AddAnchor(IDC_TOLABEL
, TOP_LEFT
);
301 AddAnchor(IDC_DATETO
, TOP_LEFT
);
304 AddAnchor(IDC_SEARCHEDIT
, TOP_LEFT
, TOP_RIGHT
);
305 AddAnchor(IDC_LOG_JUMPTYPE
, TOP_RIGHT
);
306 AddAnchor(IDC_LOG_JUMPUP
, TOP_RIGHT
);
307 AddAnchor(IDC_LOG_JUMPDOWN
, TOP_RIGHT
);
309 AddAnchor(IDC_LOGLIST
, TOP_LEFT
, TOP_RIGHT
);
310 AddAnchor(IDC_SPLITTERTOP
, TOP_LEFT
, TOP_RIGHT
);
311 AddAnchor(IDC_MSGVIEW
, TOP_LEFT
, BOTTOM_RIGHT
);
312 AddAnchor(IDC_PIC_AUTHOR
, TOP_RIGHT
);
313 AddAnchor(IDC_SPLITTERBOTTOM
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
314 AddAnchor(IDC_LOGMSG
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
316 AddAnchor(IDC_LOGINFO
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
317 AddAnchor(IDC_HIDEPATHS
, BOTTOM_LEFT
);
318 AddAnchor(IDC_LOG_ALLBRANCH
,BOTTOM_LEFT
);
319 AddAnchor(IDC_LOG_FOLLOWRENAMES
, BOTTOM_LEFT
);
320 AddAnchor(IDC_LOG_FIRSTPARENT
, BOTTOM_LEFT
);
321 AddAnchor(IDC_SHOWWHOLEPROJECT
, BOTTOM_LEFT
);
322 AddAnchor(IDC_LOG_SHOWTAGS
, BOTTOM_LEFT
);
323 AddAnchor(IDC_REFRESH
, BOTTOM_LEFT
);
324 AddAnchor(IDC_STATBUTTON
, BOTTOM_RIGHT
);
325 AddAnchor(IDC_PROGRESS
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
326 AddAnchor(IDOK
, BOTTOM_RIGHT
);
327 AddAnchor(IDCANCEL
, BOTTOM_RIGHT
);
328 AddAnchor(IDHELP
, BOTTOM_RIGHT
);
330 if(this->m_bAllBranch
)
331 m_LogList
.m_ShowMask
|=CGit::LOG_INFO_ALL_BRANCH
;
333 m_LogList
.m_ShowMask
&=~CGit::LOG_INFO_ALL_BRANCH
;
336 m_LogList
.m_ShowRefMask
|= LOGLIST_SHOWTAGS
;
338 m_LogList
.m_ShowRefMask
&= ~LOGLIST_SHOWTAGS
;
340 // SetPromptParentWindow(m_hWnd);
341 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_LOG_AUTHOREMAIL
)));
342 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_LOG_COMMITTEREMAIL
)));
343 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_LOG_MERGEPOINT
)));
344 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_LOG_PARENT1
)));
345 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_LOG_PARENT2
)));
346 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_TAG
)));
347 m_JumpType
.AddString(CString(MAKEINTRESOURCE(IDS_PROC_TAG_FF
)));
348 m_JumpType
.SetCurSel(0);
349 m_JumpUp
.SetIcon((HICON
)::LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_JUMPUP
), IMAGE_ICON
, 16, 16, LR_DEFAULTCOLOR
));
350 m_JumpDown
.SetIcon((HICON
)::LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_JUMPDOWN
), IMAGE_ICON
, 16, 16, LR_DEFAULTCOLOR
));
353 CenterWindow(CWnd::FromHandle(hWndExplorer
));
354 EnableSaveRestore(_T("LogDlg"));
356 DWORD yPos1
= CRegDWORD(_T("Software\\TortoiseGit\\TortoiseProc\\ResizableState\\LogDlgSizer1"));
357 DWORD yPos2
= CRegDWORD(_T("Software\\TortoiseGit\\TortoiseProc\\ResizableState\\LogDlgSizer2"));
358 RECT rcDlg
, rcLogList
, rcChgMsg
;
359 GetClientRect(&rcDlg
);
360 m_LogList
.GetWindowRect(&rcLogList
);
361 ScreenToClient(&rcLogList
);
362 m_ChangedFileListCtrl
.GetWindowRect(&rcChgMsg
);
363 ScreenToClient(&rcChgMsg
);
367 m_wndSplitter1
.GetWindowRect(&rectSplitter
);
368 ScreenToClient(&rectSplitter
);
369 int delta
= yPos1
- rectSplitter
.top
;
371 if ((rcLogList
.bottom
+ delta
> rcLogList
.top
)&&(rcLogList
.bottom
+ delta
< rcChgMsg
.bottom
- 30))
373 m_wndSplitter1
.SetWindowPos(NULL
, rectSplitter
.left
, yPos1
, 0, 0, SWP_NOSIZE
);
380 m_wndSplitter2
.GetWindowRect(&rectSplitter
);
381 ScreenToClient(&rectSplitter
);
382 int delta
= yPos2
- rectSplitter
.top
;
384 if ((rcChgMsg
.top
+ delta
< rcChgMsg
.bottom
)&&(rcChgMsg
.top
+ delta
> rcLogList
.top
+ 30))
386 m_wndSplitter2
.SetWindowPos(NULL
, rectSplitter
.left
, yPos2
, 0, 0, SWP_NOSIZE
);
395 // the dialog is used to select revisions
396 // enable the OK button if appropriate
401 // the dialog is used to just view log messages
402 // hide the OK button and set text on Cancel button to OK
403 GetDlgItemText(IDOK
, temp
);
404 SetDlgItemText(IDCANCEL
, temp
);
405 GetDlgItem(IDOK
)->ShowWindow(SW_HIDE
);
408 // first start a thread to obtain the log messages without
409 // blocking the dialog
411 //m_tFrom = (DWORD)-1;
413 // scroll to user selected or current revision
414 if (!m_hightlightRevision
.IsEmpty() && m_hightlightRevision
.GetLength() >= GIT_HASH_SIZE
)
415 m_LogList
.m_lastSelectedHash
= m_hightlightRevision
;
418 if (g_Git
.GetHash(m_LogList
.m_lastSelectedHash
, _T("HEAD")))
419 MessageBox(g_Git
.GetGitLastErr(_T("Could not get HEAD hash.")), _T("TortoiseGit"), MB_ICONERROR
);
422 if (m_path
.IsEmpty() || m_path
.IsDirectory())
423 DialogEnableWindow(IDC_LOG_FOLLOWRENAMES
, FALSE
);
425 m_LogList
.FetchLogAsync(this);
428 GetDlgItem(IDC_LOGLIST
)->SetFocus();
434 LRESULT
CLogDlg::OnLogListLoading(WPARAM wParam
, LPARAM
/*lParam*/)
438 if( cur
== GITLOG_START
)
441 temp
.LoadString(IDS_PROGRESSWAIT
);
443 this->m_LogList
.ShowText(temp
, true);
445 // We use a progress bar while getting the logs
446 m_LogProgress
.SetRange32(0, 100);
447 m_LogProgress
.SetPos(0);
450 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_NORMAL
);
451 m_pTaskbarList
->SetProgressValue(m_hWnd
, 0, 100);
454 GetDlgItem(IDC_PROGRESS
)->ShowWindow(TRUE
);
456 //DialogEnableWindow(IDC_SHOWWHOLEPROJECT, FALSE);
457 //DialogEnableWindow(IDC_LOG_FIRSTPARENT, FALSE);
458 DialogEnableWindow(IDC_STATBUTTON
, FALSE
);
459 //DialogEnableWindow(IDC_REFRESH, FALSE);
460 DialogEnableWindow(IDC_HIDEPATHS
,FALSE
);
463 else if( cur
== GITLOG_END
)
465 if(this->m_LogList
.HasText())
467 this->m_LogList
.ClearText();
469 UpdateLogInfoLabel();
472 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_NOPROGRESS
);
474 DialogEnableWindow(IDC_SHOWWHOLEPROJECT
, !m_bFollowRenames
);
476 DialogEnableWindow(IDC_STATBUTTON
, !(m_LogList
.m_arShownList
.IsEmpty() || m_LogList
.m_arShownList
.GetCount() == 1 && m_LogList
.m_bShowWC
));
477 DialogEnableWindow(IDC_REFRESH
, TRUE
);
478 DialogEnableWindow(IDC_HIDEPATHS
,TRUE
);
480 // PostMessage(WM_TIMER, LOGFILTER_TIMER);
481 GetDlgItem(IDC_PROGRESS
)->ShowWindow(FALSE
);
482 //CTime time=m_LogList.GetOldestTime();
484 m_LogList
.GetTimeRange(begin
,end
);
486 if(m_LogList
.m_From
== -1)
487 m_DateFrom
.SetTime(&begin
);
489 if(m_LogList
.m_To
== -1)
490 m_DateTo
.SetTime(&end
);
496 if(this->m_LogList
.HasText())
498 this->m_LogList
.ClearText();
499 this->m_LogList
.Invalidate();
501 UpdateLogInfoLabel();
502 m_LogProgress
.SetPos(cur
);
505 m_pTaskbarList
->SetProgressState(m_hWnd
, TBPF_NORMAL
);
506 m_pTaskbarList
->SetProgressValue(m_hWnd
, cur
, 100);
511 void CLogDlg::SetDlgTitle()
513 if (m_sTitle
.IsEmpty())
514 GetWindowText(m_sTitle
);
516 if (m_LogList
.m_Path
.IsEmpty() || m_orgPath
.GetWinPathString().IsEmpty())
518 CAppUtils::SetWindowTitle(m_hWnd
, g_Git
.m_CurrentDir
, m_sTitle
);
521 CAppUtils::SetWindowTitle(m_hWnd
, m_orgPath
.GetWinPathString(), m_sTitle
);
524 void CLogDlg::CheckRegexpTooltip()
526 CWnd
*pWnd
= GetDlgItem(IDC_SEARCHEDIT
);
527 // Since tooltip describes regexp features, show it only if regexps are enabled.
528 if (m_bFilterWithRegex
)
530 m_tooltips
.AddTool(pWnd
, IDS_LOG_FILTER_REGEX_TT
);
533 m_tooltips
.DelTool(pWnd
);
536 void CLogDlg::EnableOKButton()
540 // the dialog is used to select revisions
541 if (m_bSelectionMustBeSingle
)
543 // enable OK button if only a single revision is selected
544 DialogEnableWindow(IDOK
, (m_LogList
.GetSelectedCount()==1));
546 else if (m_bSelectionMustBeContinuous
)
547 DialogEnableWindow(IDOK
, (m_LogList
.GetSelectedCount()!=0)&&(m_LogList
.IsSelectionContinuous()));
549 DialogEnableWindow(IDOK
, m_LogList
.GetSelectedCount()!=0);
552 DialogEnableWindow(IDOK
, TRUE
);
555 CString
CLogDlg::GetTagInfo(GitRev
* pLogEntry
)
560 if(m_LogList
.m_HashMap
.find(pLogEntry
->m_CommitHash
) != m_LogList
.m_HashMap
.end())
562 STRING_VECTOR
&vector
= m_LogList
.m_HashMap
[pLogEntry
->m_CommitHash
];
563 for (int i
= 0; i
< vector
.size(); ++i
)
565 if(vector
[i
].Find(_T("refs/tags/")) == 0 )
567 CString tag
= vector
[i
];
568 int start
= vector
[i
].Find(_T("^{}"));
574 cmd
.Format(_T("git.exe cat-file tag %s"), tag
);
576 if(g_Git
.Run(cmd
, &output
, NULL
, CP_UTF8
) == 0 )
582 if(!output
.IsEmpty())
584 output
= _T("\n*") + CString(MAKEINTRESOURCE(IDS_PROC_LOG_TAGINFO
)) + _T("*\n\n") + output
;
590 bool LookLikeGitHash(const CString
& msg
, int &pos
)
593 for (; pos
< msg
.GetLength(); ++pos
)
595 if (msg
[pos
] >= '0' && msg
[pos
] <= '9' || msg
[pos
] >= 'a' && msg
[pos
] <= 'f')
601 return c
>= g_Git
.GetShortHASHLength() && c
<= GIT_HASH_SIZE
* 2;
604 return c
>= g_Git
.GetShortHASHLength() && c
<= GIT_HASH_SIZE
* 2;
607 std::vector
<CHARRANGE
> FindGitHashPositions(const CString
& msg
, int offset
)
609 std::vector
<CHARRANGE
> result
;
610 offset
= offset
< 0 ? 0 : offset
;
612 while (offset
< msg
.GetLength())
615 TCHAR b
= offset
> 1 ? msg
[offset
- 2] : '\0';
616 TCHAR c
= offset
> 0 ? msg
[offset
- 1] : '\0';
617 // git hash can optionally starts with 'g'
618 if ((c
== 'g' && (offset
== 0 || !((b
>= 'A' && b
<= 'Z') || (b
>= 'h' && b
<= 'z'))))
619 || (!((c
>= 'A' && c
<= 'Z') || (c
>= 'h' && c
<= 'z'))))
623 if (msg
.Mid(offset
, 11) == _T("git-svn-id:") || msg
.Mid(offset
, 14) == _T("Signed-off-by:"))
626 while (offset
< msg
.GetLength())
628 if (msg
[offset
++] == '\n')
635 if (LookLikeGitHash(msg
, offset
))
637 TCHAR d
= offset
< msg
.GetLength() ? msg
[offset
] : '\0';
638 if (!((d
>= 'A' && d
<= 'Z') || (d
>= 'g' && d
<= 'z')))
640 CHARRANGE range
= { old
, offset
};
641 result
.push_back(range
);
651 BOOL
FindGitHash(const CString
& msg
, int offset
, CWnd
*pWnd
)
653 std::vector
<CHARRANGE
> positions
= FindGitHashPositions(msg
, offset
);
654 CAppUtils::SetCharFormat(pWnd
, CFM_LINK
, CFE_LINK
, positions
);
656 return positions
.empty() ? FALSE
: TRUE
;
659 void CLogDlg::FillLogMessageCtrl(bool bShow
/* = true*/)
661 // we fill here the log message rich edit control,
662 // and also populate the changed files list control
663 // according to the selected revision(s).
665 CRichEditCtrl
* pMsgView
= (CRichEditCtrl
*)GetDlgItem(IDC_MSGVIEW
);
666 // empty the log message view
667 pMsgView
->SetWindowText(_T(" "));
668 // empty the changed files list
669 m_ChangedFileListCtrl
.SetRedraw(FALSE
);
670 // InterlockedExchange(&m_bNoDispUpdates, TRUE);
671 m_currentChangedArray
= NULL
;
672 //m_ChangedFileListCtrl.SetExtendedStyle ( LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER );
673 m_ChangedFileListCtrl
.DeleteAllItems();
675 // if we're not here to really show a selected revision, just
676 // get out of here after clearing the views, which is what is intended
677 // if that flag is not set.
681 m_ChangedFileListCtrl
.Invalidate();
682 // InterlockedExchange(&m_bNoDispUpdates, FALSE);
683 m_ChangedFileListCtrl
.SetRedraw(TRUE
);
684 m_gravatar
.LoadGravatar();
688 // depending on how many revisions are selected, we have to do different
690 int selCount
= m_LogList
.GetSelectedCount();
693 // if nothing is selected, we have nothing more to do
694 // InterlockedExchange(&m_bNoDispUpdates, FALSE);
695 m_ChangedFileListCtrl
.SetRedraw(TRUE
);
696 m_gravatar
.LoadGravatar();
699 else if (selCount
== 1)
701 // if one revision is selected, we have to fill the log message view
702 // with the corresponding log message, and also fill the changed files
704 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
705 int selIndex
= m_LogList
.GetNextSelectedItem(pos
);
706 if (selIndex
>= m_LogList
.m_arShownList
.GetCount())
708 // InterlockedExchange(&m_bNoDispUpdates, FALSE);
709 m_ChangedFileListCtrl
.SetRedraw(TRUE
);
712 Locker
lock(m_LogList
.m_critSec_AsyncDiff
);
713 GitRev
* pLogEntry
= reinterpret_cast<GitRev
*>(m_LogList
.m_arShownList
.SafeGetAt(selIndex
));
716 // set the log message text
717 pMsgView
->SetWindowText(CString(MAKEINTRESOURCE(IDS_HASH
)) + _T(": ") + pLogEntry
->m_CommitHash
.ToString() + _T("\r\n\r\n"));
718 // turn bug ID's into links if the bugtraq: properties have been set
719 // and we can find a match of those in the log message
721 pMsgView
->SetSel(-1,-1);
723 SecureZeroMemory(&format
, sizeof(CHARFORMAT2
));
724 format
.cbSize
= sizeof(CHARFORMAT2
);
725 format
.dwMask
= CFM_BOLD
;
726 format
.dwEffects
= CFE_BOLD
;
727 pMsgView
->SendMessage(EM_SETCHARFORMAT
, SCF_SELECTION
, (LPARAM
)&format
);
729 CString msg
=_T("* ");
730 msg
+=pLogEntry
->GetSubject();
731 pMsgView
->ReplaceSel(msg
);
733 pMsgView
->SetSel(-1,-1);
734 format
.dwEffects
= 0;
735 pMsgView
->SendMessage(EM_SETCHARFORMAT
, SCF_SELECTION
, (LPARAM
)&format
);
738 msg
+=pLogEntry
->GetBody();
740 if(!pLogEntry
->m_Notes
.IsEmpty())
742 msg
+= _T("\n*") + CString(MAKEINTRESOURCE(IDS_NOTES
)) + _T("* ");
743 msg
+= pLogEntry
->m_Notes
;
747 msg
+=GetTagInfo(pLogEntry
);
749 pMsgView
->ReplaceSel(msg
);
752 pMsgView
->GetWindowText(text
);
753 // the rich edit control doesn't count the CR char!
754 // to be exact: CRLF is treated as one char.
757 FindGitHash(text
, text
.Find('\n'), pMsgView
);
758 m_LogList
.m_ProjectProperties
.FindBugID(text
, pMsgView
);
759 if (((DWORD
)CRegStdDWORD(_T("Software\\TortoiseGit\\StyleCommitMessages"), TRUE
)) == TRUE
)
760 CAppUtils::FormatTextInRichEditControl(pMsgView
);
762 int HidePaths
=m_cHidePaths
.GetState() & 0x0003;
763 CString matchpath
=this->m_path
.GetGitPathString();
765 int count
= pLogEntry
->GetFiles(&m_LogList
).GetCount();
766 for (int i
= 0 ; i
< count
&& (!matchpath
.IsEmpty()); ++i
)
768 if( m_bWholeProject
)
771 ((CTGitPath
&)pLogEntry
->GetFiles(&m_LogList
)[i
]).m_Action
&= ~(CTGitPath::LOGACTIONS_HIDE
|CTGitPath::LOGACTIONS_GRAY
);
773 if(pLogEntry
->GetFiles(&m_LogList
)[i
].GetGitPathString().Left(matchpath
.GetLength()) != matchpath
&& pLogEntry
->GetFiles(&m_LogList
)[i
].GetGitOldPathString().Left(matchpath
.GetLength()) != matchpath
)
775 if(HidePaths
==BST_CHECKED
)
776 ((CTGitPath
&)pLogEntry
->GetFiles(&m_LogList
)[i
]).m_Action
|= CTGitPath::LOGACTIONS_HIDE
;
777 if(HidePaths
==BST_INDETERMINATE
)
778 ((CTGitPath
&)pLogEntry
->GetFiles(&m_LogList
)[i
]).m_Action
|= CTGitPath::LOGACTIONS_GRAY
;
782 m_ChangedFileListCtrl
.UpdateWithGitPathList(pLogEntry
->GetFiles(&m_LogList
));
783 m_ChangedFileListCtrl
.m_CurrentVersion
=pLogEntry
->m_CommitHash
;
784 if (pLogEntry
->m_CommitHash
.IsEmpty() && m_bShowUnversioned
)
786 m_ChangedFileListCtrl
.UpdateUnRevFileList(pLogEntry
->GetUnRevFiles());
787 m_ChangedFileListCtrl
.Show(GITSLC_SHOWVERSIONED
| GITSLC_SHOWUNVERSIONED
);
790 m_ChangedFileListCtrl
.Show(GITSLC_SHOWVERSIONED
);
792 m_ChangedFileListCtrl
.SetBusyString(CString(MAKEINTRESOURCE(IDS_PROC_LOG_FETCHINGFILES
)));
794 if(!pLogEntry
->m_IsDiffFiles
)
795 m_ChangedFileListCtrl
.SetBusy(TRUE
);
797 m_ChangedFileListCtrl
.SetBusy(FALSE
);
799 m_ChangedFileListCtrl
.SetRedraw(TRUE
);
800 m_gravatar
.LoadGravatar(pLogEntry
->GetAuthorEmail());
807 // more than one revision is selected:
808 // the log message view must be emptied
809 // the changed files list contains all the changed paths from all
810 // selected revisions, with 'doubles' removed
811 m_currentChangedPathList
= GetChangedPathsFromSelectedRevisions(true);
815 // InterlockedExchange(&m_bNoDispUpdates, FALSE);
817 if (m_currentChangedArray
)
819 m_ChangedFileListCtrl
.SetItemCountEx(m_currentChangedArray
->GetCount());
820 m_ChangedFileListCtrl
.RedrawItems(0, m_currentChangedArray
->GetCount());
822 else if (m_currentChangedPathList
.GetCount())
824 m_ChangedFileListCtrl
.SetItemCountEx(m_currentChangedPathList
.GetCount());
825 m_ChangedFileListCtrl
.RedrawItems(0, m_currentChangedPathList
.GetCount());
829 m_ChangedFileListCtrl
.SetItemCountEx(0);
830 m_ChangedFileListCtrl
.Invalidate();
833 // sort according to the settings
834 if (m_nSortColumnPathList
> 0)
835 SetSortArrow(&m_ChangedFileListCtrl
, m_nSortColumnPathList
, m_bAscendingPathList
);
837 SetSortArrow(&m_ChangedFileListCtrl
, -1, false);
838 m_ChangedFileListCtrl
.SetRedraw(TRUE
);
839 m_gravatar
.LoadGravatar();
843 void CLogDlg::OnBnClickedRefresh()
848 void CLogDlg::Refresh (bool clearfilter
/*autoGoOnline*/)
851 m_LogList
.Refresh(clearfilter
);
854 FillLogMessageCtrl(false);
859 BOOL
CLogDlg::Cancel()
864 void CLogDlg::SaveSplitterPos()
868 CRegDWORD regPos1
= CRegDWORD(_T("Software\\TortoiseGit\\TortoiseProc\\ResizableState\\LogDlgSizer1"));
869 CRegDWORD regPos2
= CRegDWORD(_T("Software\\TortoiseGit\\TortoiseProc\\ResizableState\\LogDlgSizer2"));
871 m_wndSplitter1
.GetWindowRect(&rectSplitter
);
872 ScreenToClient(&rectSplitter
);
873 regPos1
= rectSplitter
.top
;
874 m_wndSplitter2
.GetWindowRect(&rectSplitter
);
875 ScreenToClient(&rectSplitter
);
876 regPos2
= rectSplitter
.top
;
880 void CLogDlg::OnCancel()
882 this->ShowWindow(SW_HIDE
);
884 // canceling means stopping the working thread if it's still running.
885 m_LogList
.SafeTerminateAsyncDiffThread();
886 if (this->IsThreadRunning())
888 m_LogList
.SafeTerminateThread();
890 m_gravatar
.SafeTerminateGravatarThread();
897 void CLogDlg::CopyChangedSelectionToClipBoard()
900 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
902 return; // nothing is selected, get out of here
906 // CGitRev* pLogEntry = reinterpret_cast<CGitRev* >(m_LogList.m_arShownList.SafeGetAt(m_LogList.GetNextSelectedItem(pos)));
909 POSITION pos
= m_ChangedFileListCtrl
.GetFirstSelectedItemPosition();
912 int nItem
= m_ChangedFileListCtrl
.GetNextSelectedItem(pos
);
913 CTGitPath
*path
= (CTGitPath
*)m_ChangedFileListCtrl
.GetItemData(nItem
);
915 sPaths
+= path
->GetGitPathString();
916 sPaths
+= _T("\r\n");
922 // only one revision is selected in the log dialog top pane
923 // but multiple items could be selected in the changed items list
924 POSITION pos
= m_ChangedFileListCtrl
.GetFirstSelectedItemPosition();
927 int nItem
= m_ChangedFileListCtrl
.GetNextSelectedItem(pos
);
928 LogChangedPath
* changedlogpath
= pLogEntry
->pArChangedPaths
->SafeGetAt(nItem
);
930 if ((m_cHidePaths
.GetState() & 0x0003)==BST_CHECKED
)
932 // some items are hidden! So find out which item the user really selected
933 INT_PTR selRealIndex
= -1;
934 for (INT_PTR hiddenindex
=0; hiddenindex
<pLogEntry
->pArChangedPaths
->GetCount(); ++hiddenindex
)
936 if (pLogEntry
->pArChangedPaths
->SafeGetAt(hiddenindex
)->sPath
.Left(m_sRelativeRoot
.GetLength()).Compare(m_sRelativeRoot
)==0)
938 if (selRealIndex
== nItem
)
940 changedlogpath
= pLogEntry
->pArChangedPaths
->SafeGetAt(hiddenindex
);
947 sPaths
+= changedlogpath
->sPath
;
948 sPaths
+= _T("\r\n");
954 CStringUtils::WriteAsciiStringToClipboard(sPaths
, GetSafeHwnd());
958 void CLogDlg::OnContextMenu(CWnd
* pWnd
, CPoint point
)
960 // we have two separate context menus:
961 // one shown on the log message list control,
962 // the other shown in the changed-files list control
963 int selCount
= m_LogList
.GetSelectedCount();
964 if ((selCount
== 1)&&(pWnd
== GetDlgItem(IDC_MSGVIEW
)))
966 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
969 selIndex
= m_LogList
.GetNextSelectedItem(pos
);
971 GitRev
*pRev
= ((GitRev
*)m_LogList
.m_arShownList
[selIndex
]);
973 if ((point
.x
== -1) && (point
.y
== -1))
976 GetDlgItem(IDC_MSGVIEW
)->GetClientRect(&rect
);
977 ClientToScreen(&rect
);
978 point
= rect
.CenterPoint();
980 CString sMenuItemText
;
982 if (popup
.CreatePopupMenu())
984 // add the 'default' entries
985 sMenuItemText
.LoadString(IDS_SCIEDIT_COPY
);
986 popup
.AppendMenu(MF_STRING
| MF_ENABLED
, WM_COPY
, sMenuItemText
);
987 sMenuItemText
.LoadString(IDS_SCIEDIT_SELECTALL
);
988 popup
.AppendMenu(MF_STRING
| MF_ENABLED
, EM_SETSEL
, sMenuItemText
);
989 sMenuItemText
.LoadString(IDS_EDIT_NOTES
);
990 popup
.AppendMenuIcon( CGitLogList::ID_EDITNOTE
, sMenuItemText
, IDI_EDIT
);
992 int cmd
= popup
.TrackPopupMenu(TPM_RETURNCMD
| TPM_LEFTALIGN
| TPM_NONOTIFY
, point
.x
, point
.y
, this, 0);
996 break; // no command selected
999 ::SendMessage(GetDlgItem(IDC_MSGVIEW
)->GetSafeHwnd(), cmd
, 0, -1);
1001 case CGitLogList::ID_EDITNOTE
:
1002 CAppUtils::EditNote(pRev
);
1003 this->FillLogMessageCtrl(true);
1010 void CLogDlg::OnOK()
1012 // since the log dialog is also used to select revisions for other
1013 // dialogs, we have to do some work before closing this dialog
1014 if (GetFocus() != GetDlgItem(IDOK
))
1015 return; // if the "OK" button doesn't have the focus, do nothing: this prevents closing the dialog when pressing enter
1017 m_LogList
.SafeTerminateAsyncDiffThread();
1018 if (this->IsThreadRunning())
1020 m_LogList
.SafeTerminateThread();
1022 m_gravatar
.SafeTerminateGravatarThread();
1024 // check that one and only one row is selected
1025 if (m_LogList
.GetSelectedCount() == 1)
1027 // get the selected row
1028 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
1029 int selIndex
= m_LogList
.GetNextSelectedItem(pos
);
1030 if (selIndex
< m_LogList
.m_arShownList
.GetCount())
1032 // all ok, pick up the revision
1033 GitRev
* pLogEntry
= reinterpret_cast<GitRev
*>(m_LogList
.m_arShownList
.SafeGetAt(selIndex
));
1035 m_sSelectedHash
= pLogEntry
->m_CommitHash
;
1043 if (!GetDlgItem(IDOK
)->IsWindowVisible() && GetFocus() != GetDlgItem(IDCANCEL
))
1044 return; // the Cancel button works as the OK button. But if the cancel button has not the focus, do nothing.
1048 GetDlgItemText(IDOK
, buttontext
);
1049 temp
.LoadString(IDS_MSGBOX_CANCEL
);
1050 if (temp
.Compare(buttontext
) != 0)
1051 __super::OnOK(); // only exit if the button text matches, and that will match only if the thread isn't running anymore
1052 m_bCancelled
= TRUE
;
1053 m_selectedRevs
.Clear();
1054 m_selectedRevsOneRange
.Clear();
1055 if (m_pNotifyWindow
)
1057 int selIndex
= m_LogList
.GetSelectionMark();
1060 PLOGENTRYDATA pLogEntry
= NULL
;
1061 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
1062 pLogEntry
= reinterpret_cast<PLOGENTRYDATA
>(m_arShownList
.SafeGetAt(m_LogList
.GetNextSelectedItem(pos
)));
1063 m_selectedRevs
.AddRevision(pLogEntry
->Rev
);
1064 git_revnum_t lowerRev
= pLogEntry
->Rev
;
1065 git_revnum_t higherRev
= lowerRev
;
1068 pLogEntry
= reinterpret_cast<PLOGENTRYDATA
>(m_arShownList
.SafeGetAt(m_LogList
.GetNextSelectedItem(pos
)));
1069 git_revnum_t rev
= pLogEntry
->Rev
;
1070 m_selectedRevs
.AddRevision(pLogEntry
->Rev
);
1073 if (higherRev
< rev
)
1076 if (m_sFilterText
.IsEmpty() && m_nSortColumn
== 0 && IsSelectionContinuous())
1078 m_selectedRevsOneRange
.AddRevRange(lowerRev
, higherRev
);
1080 BOOL bSentMessage
= FALSE
;
1081 if (m_LogList
.GetSelectedCount() == 1)
1083 // if only one revision is selected, check if the path/url with which the dialog was started
1084 // was directly affected in that revision. If it was, then check if our path was copied from somewhere.
1085 // if it was copied, use the copy from revision as lowerRev
1086 if ((pLogEntry
)&&(pLogEntry
->pArChangedPaths
)&&(lowerRev
== higherRev
))
1088 CString sUrl
= m_path
.GetGitPathString();
1089 if (!m_path
.IsUrl())
1091 sUrl
= GetURLFromPath(m_path
);
1093 sUrl
= sUrl
.Mid(m_sRepositoryRoot
.GetLength());
1094 for (int cp
= 0; cp
< pLogEntry
->pArChangedPaths
->GetCount(); ++cp
)
1096 LogChangedPath
* pData
= pLogEntry
->pArChangedPaths
->SafeGetAt(cp
);
1099 if (sUrl
.Compare(pData
->sPath
) == 0)
1101 if (!pData
->sCopyFromPath
.IsEmpty())
1103 lowerRev
= pData
->lCopyFromRev
;
1104 m_pNotifyWindow
->SendMessage(WM_REVSELECTED
, m_wParam
& (MERGE_REVSELECTSTART
), lowerRev
);
1105 m_pNotifyWindow
->SendMessage(WM_REVSELECTED
, m_wParam
& (MERGE_REVSELECTEND
), higherRev
);
1106 m_pNotifyWindow
->SendMessage(WM_REVLIST
, m_selectedRevs
.GetCount(), (LPARAM
)&m_selectedRevs
);
1107 bSentMessage
= TRUE
;
1114 if ( !bSentMessage
)
1116 m_pNotifyWindow
->SendMessage(WM_REVSELECTED
, m_wParam
& (MERGE_REVSELECTSTART
| MERGE_REVSELECTMINUSONE
), lowerRev
);
1117 m_pNotifyWindow
->SendMessage(WM_REVSELECTED
, m_wParam
& (MERGE_REVSELECTEND
| MERGE_REVSELECTMINUSONE
), higherRev
);
1118 m_pNotifyWindow
->SendMessage(WM_REVLIST
, m_selectedRevs
.GetCount(), (LPARAM
)&m_selectedRevs
);
1119 if (m_selectedRevsOneRange
.GetCount())
1120 m_pNotifyWindow
->SendMessage(WM_REVLISTONERANGE
, 0, (LPARAM
)&m_selectedRevsOneRange
);
1125 CRegDWORD reg
= CRegDWORD(_T("Software\\TortoiseGit\\ShowAllEntry"));
1130 void CLogDlg::DoDiffFromLog(INT_PTR selIndex
, GitRev
* rev1
, GitRev
* rev2
, bool /*blame*/, bool /*unified*/)
1132 DialogEnableWindow(IDOK
, FALSE
);
1133 // SetPromptApp(&theApp);
1134 theApp
.DoWaitCursor(1);
1137 GetTempPath(temppath
);
1140 file1
.Format(_T("%s%s_%s%s"),
1142 (*m_currentChangedArray
)[selIndex
].GetBaseFilename(),
1143 rev1
->m_CommitHash
.ToString().Left(g_Git
.GetShortHASHLength()),
1144 (*m_currentChangedArray
)[selIndex
].GetFileExtension());
1147 file2
.Format(_T("%s\\%s_%s%s"),
1149 (*m_currentChangedArray
)[selIndex
].GetBaseFilename(),
1150 rev2
->m_CommitHash
.ToString().Left(g_Git
.GetShortHASHLength()),
1151 (*m_currentChangedArray
)[selIndex
].GetFileExtension());
1154 CTGitPath
&path
= (CTGitPath
&)(*m_currentChangedArray
)[selIndex
];
1156 g_Git
.GetOneFile(rev1
->m_CommitHash
.ToString(), path
, file1
);
1157 g_Git
.GetOneFile(rev2
->m_CommitHash
.ToString(), path
, file2
);
1159 CAppUtils::DiffFlags flags
;
1160 CAppUtils::StartExtDiff(file1
,file2
,_T("A"),_T("B"),
1161 g_Git
.m_CurrentDir
+ _T("\\") + path
.GetWinPathString(), g_Git
.m_CurrentDir
+ _T("\\") + path
.GetWinPathString(),
1162 rev1
->m_CommitHash
.ToString(), rev2
->m_CommitHash
.ToString(),
1165 theApp
.DoWaitCursor(-1);
1169 BOOL
CLogDlg::PreTranslateMessage(MSG
* pMsg
)
1171 // Skip Ctrl-C when copying text out of the log message or search filter
1172 bool bSkipAccelerator
= (pMsg
->message
== WM_KEYDOWN
&& (pMsg
->wParam
== 'C' || pMsg
->wParam
== VK_INSERT
) && (GetFocus() == GetDlgItem(IDC_MSGVIEW
) || GetFocus() == GetDlgItem(IDC_SEARCHEDIT
)) && GetKeyState(VK_CONTROL
) & 0x8000);
1173 if (pMsg
->message
== WM_KEYDOWN
&& pMsg
->wParam
=='\r')
1175 if (GetFocus()==GetDlgItem(IDC_LOGLIST
))
1177 if (CRegDWORD(_T("Software\\TortoiseGit\\DiffByDoubleClickInLog"), FALSE
))
1179 m_LogList
.DiffSelectedRevWithPrevious();
1183 if (GetFocus() == GetDlgItem(IDC_SEARCHEDIT
))
1185 KillTimer(LOGFILTER_TIMER
);
1187 m_LogList
.Refresh(FALSE
);
1188 FillLogMessageCtrl(false);
1191 if (m_hAccel
&& !bSkipAccelerator
)
1193 int ret
= TranslateAccelerator(m_hWnd
, m_hAccel
, pMsg
);
1198 if(::IsWindow(m_tooltips
.m_hWnd
))
1199 m_tooltips
.RelayEvent(pMsg
);
1200 return __super::PreTranslateMessage(pMsg
);
1204 BOOL
CLogDlg::OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
)
1206 //if (this->IsThreadRunning())
1207 if(m_LogList
.m_bNoDispUpdates
)
1209 // only show the wait cursor over the list control
1211 ((pWnd
== GetDlgItem(IDC_LOGLIST
))||
1212 (pWnd
== GetDlgItem(IDC_MSGVIEW
))||
1213 (pWnd
== GetDlgItem(IDC_LOGMSG
))))
1215 HCURSOR hCur
= LoadCursor(NULL
, MAKEINTRESOURCE(IDC_WAIT
));
1220 if ((pWnd
) && (pWnd
== GetDlgItem(IDC_MSGVIEW
)))
1221 return CResizableStandAloneDialog::OnSetCursor(pWnd
, nHitTest
, message
);
1223 HCURSOR hCur
= LoadCursor(NULL
, MAKEINTRESOURCE(IDC_ARROW
));
1225 return CResizableStandAloneDialog::OnSetCursor(pWnd
, nHitTest
, message
);
1228 void CLogDlg::OnLvnItemchangedLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
1230 LPNMLISTVIEW pNMLV
= reinterpret_cast<LPNMLISTVIEW
>(pNMHDR
);
1232 //if (this->IsThreadRunning())
1233 if(m_LogList
.m_bNoDispUpdates
)
1235 if (pNMLV
->iItem
>= 0)
1237 this->m_LogList
.m_nSearchIndex
= pNMLV
->iItem
;
1238 GitRev
* pLogEntry
= reinterpret_cast<GitRev
*>(m_LogList
.m_arShownList
.SafeGetAt(pNMLV
->iItem
));
1239 m_LogList
.m_lastSelectedHash
= pLogEntry
->m_CommitHash
;
1240 if (pNMLV
->iSubItem
!= 0)
1242 if ((pNMLV
->iItem
== m_LogList
.m_arShownList
.GetCount()))
1244 // remove the selected state
1245 if (pNMLV
->uChanged
& LVIF_STATE
)
1247 m_LogList
.SetItemState(pNMLV
->iItem
, 0, LVIS_SELECTED
);
1248 FillLogMessageCtrl();
1250 UpdateLogInfoLabel();
1254 if (pNMLV
->uChanged
& LVIF_STATE
)
1256 FillLogMessageCtrl();
1262 m_LogList
.m_lastSelectedHash
.Empty();
1263 FillLogMessageCtrl();
1267 UpdateLogInfoLabel();
1270 void CLogDlg::OnLvnItemchangedLogmsg(NMHDR
* /*pNMHDR*/, LRESULT
* /*pResult*/)
1272 UpdateLogInfoLabel();
1275 void CLogDlg::OnEnLinkMsgview(NMHDR
*pNMHDR
, LRESULT
*pResult
)
1277 ENLINK
*pEnLink
= reinterpret_cast<ENLINK
*>(pNMHDR
);
1278 if (pEnLink
->msg
== WM_LBUTTONUP
)
1281 GetDlgItemText(IDC_MSGVIEW
, msg
);
1282 msg
.Replace(_T("\r\n"), _T("\n"));
1283 url
= msg
.Mid(pEnLink
->chrg
.cpMin
, pEnLink
->chrg
.cpMax
-pEnLink
->chrg
.cpMin
);
1285 if (LookLikeGitHash(url
, pos
))
1288 for (int i
= 0; i
< m_LogList
.m_arShownList
.GetCount(); ++i
)
1290 GitRev
*rev
= (GitRev
*)m_LogList
.m_arShownList
.SafeGetAt(i
);
1292 if (rev
->m_CommitHash
.ToString().Left(url
.GetLength()) == url
)
1294 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
1297 int index
= m_LogList
.GetNextSelectedItem(pos
);
1299 m_LogList
.SetItemState(index
, 0, LVIS_SELECTED
);
1301 m_LogList
.SetItemState(i
, LVIS_SELECTED
, LVIS_SELECTED
);
1302 m_LogList
.EnsureVisible(i
, FALSE
);
1303 m_LogList
.SetSelectionMark(i
);
1310 CMessageBox::ShowCheck(GetSafeHwnd(), IDS_PROC_LOG_JUMPNOTFOUND
, IDS_APPNAME
, 1, IDI_INFORMATION
, IDS_OKBUTTON
, 0, 0, _T("NoJumpNotFoundWarning"), IDS_MSGBOX_DONOTSHOWAGAIN
);
1314 if (!::PathIsURL(url
))
1316 url
= m_LogList
.m_ProjectProperties
.GetBugIDUrl(url
);
1317 url
= GetAbsoluteUrlFromRelativeUrl(url
);
1320 ShellExecute(this->m_hWnd
, _T("open"), url
, NULL
, NULL
, SW_SHOWDEFAULT
);
1326 void CLogDlg::OnBnClickedStatbutton()
1328 if (this->IsThreadRunning())
1330 if (m_LogList
.m_arShownList
.IsEmpty() || m_LogList
.m_arShownList
.GetCount() == 1 && m_LogList
.m_bShowWC
)
1331 return; // nothing or just the working copy changes are shown, so no statistics.
1332 // the statistics dialog expects the log entries to be sorted by date
1333 SortByColumn(3, false);
1336 m_LogList
.RecalculateShownList(&dlg
.m_ShowList
);
1338 dlg
.m_path
= m_orgPath
;
1340 // restore the previous sorting
1341 SortByColumn(m_nSortColumn
, m_bAscending
);
1342 OnTimer(LOGFILTER_TIMER
);
1345 void CLogDlg::MoveToSameTop(CWnd
*pWndRef
, CWnd
*pWndTarget
)
1347 CRect rcWndPicAuthor
, rcWndMsgView
;
1348 pWndRef
->GetWindowRect(rcWndMsgView
);
1349 ScreenToClient(rcWndMsgView
);
1350 pWndTarget
->GetWindowRect(rcWndPicAuthor
);
1351 ScreenToClient(rcWndPicAuthor
);
1352 int diff
= rcWndMsgView
.top
- rcWndPicAuthor
.top
;
1353 rcWndPicAuthor
.top
+= diff
;
1354 rcWndPicAuthor
.bottom
+= diff
;
1355 pWndTarget
->MoveWindow(rcWndPicAuthor
);
1358 void CLogDlg::DoSizeV1(int delta
)
1361 RemoveAnchor(IDC_LOGLIST
);
1362 RemoveAnchor(IDC_SPLITTERTOP
);
1363 RemoveAnchor(IDC_MSGVIEW
);
1364 RemoveAnchor(IDC_PIC_AUTHOR
);
1365 RemoveAnchor(IDC_SPLITTERBOTTOM
);
1366 RemoveAnchor(IDC_LOGMSG
);
1367 CSplitterControl::ChangeHeight(&m_LogList
, delta
, CW_TOPALIGN
);
1368 CSplitterControl::ChangeHeight(GetDlgItem(IDC_MSGVIEW
), -delta
, CW_BOTTOMALIGN
);
1369 MoveToSameTop(GetDlgItem(IDC_MSGVIEW
), GetDlgItem(IDC_PIC_AUTHOR
));
1370 AddAnchor(IDC_LOGLIST
, TOP_LEFT
, TOP_RIGHT
);
1371 AddAnchor(IDC_SPLITTERTOP
, TOP_LEFT
, TOP_RIGHT
);
1372 AddAnchor(IDC_MSGVIEW
, TOP_LEFT
, BOTTOM_RIGHT
);
1373 AddAnchor(IDC_PIC_AUTHOR
, TOP_RIGHT
);
1374 AddAnchor(IDC_SPLITTERBOTTOM
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
1375 AddAnchor(IDC_LOGMSG
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
1379 m_LogList
.Invalidate();
1380 GetDlgItem(IDC_MSGVIEW
)->Invalidate();
1381 m_gravatar
.Invalidate();
1385 void CLogDlg::DoSizeV2(int delta
)
1388 RemoveAnchor(IDC_LOGLIST
);
1389 RemoveAnchor(IDC_SPLITTERTOP
);
1390 RemoveAnchor(IDC_MSGVIEW
);
1391 RemoveAnchor(IDC_PIC_AUTHOR
);
1392 RemoveAnchor(IDC_SPLITTERBOTTOM
);
1393 RemoveAnchor(IDC_LOGMSG
);
1394 CSplitterControl::ChangeHeight(GetDlgItem(IDC_MSGVIEW
), delta
, CW_TOPALIGN
);
1395 CSplitterControl::ChangeHeight(&m_ChangedFileListCtrl
, -delta
, CW_BOTTOMALIGN
);
1396 AddAnchor(IDC_LOGLIST
, TOP_LEFT
, TOP_RIGHT
);
1397 AddAnchor(IDC_SPLITTERTOP
, TOP_LEFT
, TOP_RIGHT
);
1398 AddAnchor(IDC_MSGVIEW
, TOP_LEFT
, BOTTOM_RIGHT
);
1399 AddAnchor(IDC_PIC_AUTHOR
, TOP_RIGHT
);
1400 AddAnchor(IDC_SPLITTERBOTTOM
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
1401 AddAnchor(IDC_LOGMSG
, BOTTOM_LEFT
, BOTTOM_RIGHT
);
1405 GetDlgItem(IDC_MSGVIEW
)->Invalidate();
1406 m_ChangedFileListCtrl
.Invalidate();
1407 m_gravatar
.Invalidate();
1411 void CLogDlg::AdjustMinSize()
1413 // adjust the minimum size of the dialog to prevent the resizing from
1414 // moving the list control too far down.
1415 CRect rcChgListView
;
1416 m_ChangedFileListCtrl
.GetClientRect(rcChgListView
);
1418 m_LogList
.GetClientRect(rcLogList
);
1420 SetMinTrackSize(CSize(m_DlgOrigRect
.Width(),
1421 m_DlgOrigRect
.Height()-m_ChgOrigRect
.Height()-m_LogListOrigRect
.Height()-m_MsgViewOrigRect
.Height()
1422 +rcChgListView
.Height()+rcLogList
.Height()+60));
1425 LRESULT
CLogDlg::DefWindowProc(UINT message
, WPARAM wParam
, LPARAM lParam
)
1429 if (wParam
== IDC_SPLITTERTOP
)
1431 SPC_NMHDR
* pHdr
= (SPC_NMHDR
*) lParam
;
1432 DoSizeV1(pHdr
->delta
);
1434 else if (wParam
== IDC_SPLITTERBOTTOM
)
1436 SPC_NMHDR
* pHdr
= (SPC_NMHDR
*) lParam
;
1437 DoSizeV2(pHdr
->delta
);
1442 return CResizableDialog::DefWindowProc(message
, wParam
, lParam
);
1445 void CLogDlg::SetSplitterRange()
1447 if ((m_LogList
)&&(m_ChangedFileListCtrl
))
1450 m_LogList
.GetWindowRect(rcTop
);
1451 ScreenToClient(rcTop
);
1453 GetDlgItem(IDC_MSGVIEW
)->GetWindowRect(rcMiddle
);
1454 ScreenToClient(rcMiddle
);
1455 m_wndSplitter1
.SetRange(rcTop
.top
+30, rcMiddle
.bottom
-20);
1457 m_ChangedFileListCtrl
.GetWindowRect(rcBottom
);
1458 ScreenToClient(rcBottom
);
1459 m_wndSplitter2
.SetRange(rcMiddle
.top
+30, rcBottom
.bottom
-20);
1463 LRESULT
CLogDlg::OnClickedInfoIcon(WPARAM
/*wParam*/, LPARAM lParam
)
1465 // FIXME: x64 version would get this function called with unexpected parameters.
1469 RECT
* rect
= (LPRECT
)lParam
;
1472 point
= CPoint(rect
->left
, rect
->bottom
);
1473 #define LOGMENUFLAGS(x) (MF_STRING | MF_ENABLED | (m_LogList.m_SelectedFilters & x ? MF_CHECKED : MF_UNCHECKED))
1475 if (popup
.CreatePopupMenu())
1477 temp
.LoadString(IDS_LOG_FILTER_SUBJECT
);
1478 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_SUBJECT
), LOGFILTER_SUBJECT
, temp
);
1480 temp
.LoadString(IDS_LOG_FILTER_MESSAGES
);
1481 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_MESSAGES
), LOGFILTER_MESSAGES
, temp
);
1483 temp
.LoadString(IDS_LOG_FILTER_PATHS
);
1484 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_PATHS
), LOGFILTER_PATHS
, temp
);
1486 temp
.LoadString(IDS_LOG_FILTER_AUTHORS
);
1487 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_AUTHORS
), LOGFILTER_AUTHORS
, temp
);
1489 temp
.LoadString(IDS_LOG_FILTER_EMAILS
);
1490 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_EMAILS
), LOGFILTER_EMAILS
, temp
);
1492 temp
.LoadString(IDS_LOG_FILTER_REVS
);
1493 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_REVS
), LOGFILTER_REVS
, temp
);
1495 temp
.LoadString(IDS_LOG_FILTER_REFNAME
);
1496 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_REFNAME
), LOGFILTER_REFNAME
, temp
);
1498 if (m_LogList
.m_bShowBugtraqColumn
== TRUE
) {
1499 temp
.LoadString(IDS_LOG_FILTER_BUGIDS
);
1500 popup
.AppendMenu(LOGMENUFLAGS(LOGFILTER_BUGID
), LOGFILTER_BUGID
, temp
);
1503 popup
.AppendMenu(MF_SEPARATOR
, NULL
);
1505 temp
.LoadString(IDS_LOG_FILTER_REGEX
);
1506 popup
.AppendMenu(MF_STRING
| MF_ENABLED
| (m_bFilterWithRegex
? MF_CHECKED
: MF_UNCHECKED
), LOGFILTER_REGEX
, temp
);
1509 int selection
= popup
.TrackPopupMenu(TPM_RETURNCMD
| TPM_LEFTALIGN
| TPM_NONOTIFY
, point
.x
, point
.y
, this, 0);
1513 if (selection
== LOGFILTER_REGEX
)
1515 m_bFilterWithRegex
= !m_bFilterWithRegex
;
1516 CRegDWORD b
= CRegDWORD(_T("Software\\TortoiseGit\\UseRegexFilter"), TRUE
);
1517 b
= m_bFilterWithRegex
;
1518 m_LogList
.m_bFilterWithRegex
= m_bFilterWithRegex
;
1520 CheckRegexpTooltip();
1524 m_LogList
.m_SelectedFilters
^= selection
;
1527 // Reload only if a search text is entered
1528 if (!m_LogList
.m_sFilterText
.IsEmpty())
1529 SetTimer(LOGFILTER_TIMER
, 1000, NULL
);
1535 LRESULT
CLogDlg::OnClickedCancelFilter(WPARAM
/*wParam*/, LPARAM
/*lParam*/)
1538 KillTimer(LOGFILTER_TIMER
);
1540 m_LogList
.m_sFilterText
.Empty();
1542 theApp
.DoWaitCursor(1);
1543 CStoreSelection
storeselection(this);
1544 FillLogMessageCtrl(false);
1546 m_LogList
.RemoveFilter();
1551 m_LogList
.GetTimeRange(begin
,end
);
1552 m_DateFrom
.SetTime(&begin
);
1553 m_DateTo
.SetTime(&end
);
1555 theApp
.DoWaitCursor(-1);
1556 GetDlgItem(IDC_SEARCHEDIT
)->ShowWindow(SW_HIDE
);
1557 GetDlgItem(IDC_SEARCHEDIT
)->ShowWindow(SW_SHOW
);
1558 GetDlgItem(IDC_SEARCHEDIT
)->SetFocus();
1559 UpdateLogInfoLabel();
1565 void CLogDlg::SetFilterCueText()
1567 CString
temp(MAKEINTRESOURCE(IDS_LOG_FILTER_BY
));
1570 if (m_LogList
.m_SelectedFilters
& LOGFILTER_SUBJECT
)
1572 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_SUBJECT
));
1575 if (m_LogList
.m_SelectedFilters
& LOGFILTER_MESSAGES
)
1577 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1579 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_MESSAGES
));
1582 if (m_LogList
.m_SelectedFilters
& LOGFILTER_PATHS
)
1584 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1586 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_PATHS
));
1589 if (m_LogList
.m_SelectedFilters
& LOGFILTER_AUTHORS
)
1591 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1593 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_AUTHORS
));
1596 if (m_LogList
.m_SelectedFilters
& LOGFILTER_EMAILS
)
1598 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1600 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_EMAILS
));
1603 if (m_LogList
.m_SelectedFilters
& LOGFILTER_REVS
)
1605 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1607 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_REVS
));
1610 if (m_LogList
.m_SelectedFilters
& LOGFILTER_REFNAME
)
1612 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1614 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_REFNAME
));
1617 if (m_LogList
.m_SelectedFilters
& LOGFILTER_BUGID
)
1619 if (temp
.ReverseFind(_T(' ')) != temp
.GetLength() - 1)
1621 temp
+= CString(MAKEINTRESOURCE(IDS_LOG_FILTER_BUGIDS
));
1624 // to make the cue banner text appear more to the right of the edit control
1625 temp
= _T(" ")+temp
;
1626 m_cFilter
.SetCueBanner(temp
.TrimRight());
1629 bool CLogDlg::Validate(LPCTSTR string
)
1631 if (!m_bFilterWithRegex
)
1633 std::tr1::wregex pat
;
1634 return m_LogList
.ValidateRegexp(string
, pat
, false);
1638 void CLogDlg::OnTimer(UINT_PTR nIDEvent
)
1640 if (nIDEvent
== LOGFTIME_TIMER
)
1642 KillTimer(LOGFTIME_TIMER
);
1644 m_LogList
.Refresh(FALSE
);
1645 FillLogMessageCtrl(false);
1648 if (nIDEvent
== LOGFILTER_TIMER
)
1650 KillTimer(LOGFILTER_TIMER
);
1652 m_LogList
.Refresh(FALSE
);
1653 FillLogMessageCtrl(false);
1656 /* we will use git built-in grep to filter log */
1657 if (this->IsThreadRunning())
1659 // thread still running! So just restart the timer.
1660 SetTimer(LOGFILTER_TIMER
, 1000, NULL
);
1663 CWnd
* focusWnd
= GetFocus();
1664 bool bSetFocusToFilterControl
= ((focusWnd
!= GetDlgItem(IDC_DATEFROM
))&&(focusWnd
!= GetDlgItem(IDC_DATETO
))
1665 && (focusWnd
!= GetDlgItem(IDC_LOGLIST
)));
1666 if (m_LogList
.m_sFilterText
.IsEmpty())
1668 DialogEnableWindow(IDC_STATBUTTON
, !(((this->IsThreadRunning())||(m_LogList
.m_arShownList
.IsEmpty()))));
1669 // do not return here!
1670 // we also need to run the filter if the filter text is empty:
1671 // 1. to clear an existing filter
1672 // 2. to rebuild the m_arShownList after sorting
1674 theApp
.DoWaitCursor(1);
1675 CStoreSelection
storeselection(this);
1676 KillTimer(LOGFILTER_TIMER
);
1677 FillLogMessageCtrl(false);
1679 // now start filter the log list
1680 m_LogList
.StartFilter();
1682 if ( m_LogList
.GetItemCount()==1 )
1684 m_LogList
.SetSelectionMark(0);
1685 m_LogList
.SetItemState(0, LVIS_SELECTED
, LVIS_SELECTED
);
1687 theApp
.DoWaitCursor(-1);
1688 GetDlgItem(IDC_SEARCHEDIT
)->ShowWindow(SW_HIDE
);
1689 GetDlgItem(IDC_SEARCHEDIT
)->ShowWindow(SW_SHOW
);
1690 if (bSetFocusToFilterControl
)
1691 GetDlgItem(IDC_SEARCHEDIT
)->SetFocus();
1692 UpdateLogInfoLabel();
1694 } // if (nIDEvent == LOGFILTER_TIMER)
1695 DialogEnableWindow(IDC_STATBUTTON
, !(((this->IsThreadRunning())||(m_LogList
.m_arShownList
.IsEmpty() || m_LogList
.m_arShownList
.GetCount() == 1 && m_LogList
.m_bShowWC
))));
1696 __super::OnTimer(nIDEvent
);
1699 void CLogDlg::OnDtnDatetimechangeDateto(NMHDR
* /*pNMHDR*/, LRESULT
*pResult
)
1704 m_DateTo
.GetTime(_time
);
1706 CTime
time(_time
.GetYear(), _time
.GetMonth(), _time
.GetDay(), 23, 59, 59);
1707 if (time
.GetTime() != m_LogList
.m_To
)
1709 m_LogList
.m_To
= (DWORD
)time
.GetTime();
1710 SetTimer(LOGFTIME_TIMER
, 10, NULL
);
1715 CMessageBox::Show(NULL
,_T("Invalidate Parameter"),_T("TortoiseGit"),MB_OK
|MB_ICONERROR
);
1721 void CLogDlg::OnDtnDatetimechangeDatefrom(NMHDR
* /*pNMHDR*/, LRESULT
*pResult
)
1727 m_DateFrom
.GetTime(_time
);
1729 CTime
time(_time
.GetYear(), _time
.GetMonth(), _time
.GetDay(), 0, 0, 0);
1730 if (time
.GetTime() != m_LogList
.m_From
)
1732 m_LogList
.m_From
= (DWORD
)time
.GetTime();
1733 SetTimer(LOGFTIME_TIMER
, 10, NULL
);
1738 CMessageBox::Show(NULL
,_T("Invalidate Parameter"),_T("TortoiseGit"),MB_OK
|MB_ICONERROR
);
1744 void CLogDlg::OnCbnSelchangeJumpType()
1746 // reserved for future use
1749 void CLogDlg::OnBnClickedJumpUp()
1751 int sel
= m_JumpType
.GetCurSel();
1752 if (sel
< 0) return;
1753 JumpType jumpType
= (JumpType
)sel
;
1758 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
1761 index
= m_LogList
.GetNextSelectedItem(pos
);
1762 if (index
== 0) return;
1764 GitRev
* data
= (GitRev
*)m_LogList
.m_arShownList
.SafeGetAt(index
);
1765 if (jumpType
== JumpType_AuthorEmail
)
1766 strValue
= data
->GetAuthorEmail();
1767 else if (jumpType
== JumpType_CommitterEmail
)
1768 strValue
= data
->GetCommitterEmail();
1769 else if (jumpType
== JumpType_Parent1
)
1770 hashValue
= data
->m_CommitHash
;
1771 else if (jumpType
== JumpType_Parent2
)
1772 hashValue
= data
->m_CommitHash
;
1773 else if (jumpType
== JumpType_TagFF
)
1774 hashValue
= data
->m_CommitHash
;
1776 m_LogList
.SetItemState(index
, 0, LVIS_SELECTED
);
1783 index
= m_LogList
.GetNextSelectedItem(pos
);
1784 m_LogList
.SetItemState(index
, 0, LVIS_SELECTED
);
1786 m_LogList
.SetSelectionMark(-1);
1788 for (int i
= index
- 1; i
>= 0; i
--)
1791 GitRev
* data
= (GitRev
*)m_LogList
.m_arShownList
.SafeGetAt(i
);
1792 if (jumpType
== JumpType_AuthorEmail
)
1793 found
= strValue
== data
->GetAuthorEmail();
1794 else if (jumpType
== JumpType_CommitterEmail
)
1795 found
= strValue
== data
->GetCommitterEmail();
1796 else if (jumpType
== JumpType_MergePoint
)
1797 found
= data
->ParentsCount() > 1;
1798 else if (jumpType
== JumpType_Parent1
)
1800 if (data
->m_ParentHash
.size() > 0)
1801 found
= data
->m_ParentHash
[0] == hashValue
;
1803 else if (jumpType
== JumpType_Parent2
)
1805 if (data
->m_ParentHash
.size() > 1)
1806 found
= data
->m_ParentHash
[1] == hashValue
;
1808 else if (jumpType
== JumpType_Tag
|| jumpType
== JumpType_TagFF
)
1810 STRING_VECTOR refList
= m_LogList
.m_HashMap
[data
->m_CommitHash
];
1811 for (int j
= 0; j
< refList
.size(); ++j
)
1813 if (refList
[j
].Left(10) == _T("refs/tags/"))
1820 if (found
&& jumpType
== JumpType_TagFF
)
1821 found
= g_Git
.IsFastForward(hashValue
, data
->m_CommitHash
);
1826 m_LogList
.SetItemState(i
, LVIS_SELECTED
, LVIS_SELECTED
);
1827 m_LogList
.EnsureVisible(i
, FALSE
);
1828 m_LogList
.SetSelectionMark(i
);
1833 CMessageBox::ShowCheck(GetSafeHwnd(), IDS_PROC_LOG_JUMPNOTFOUND
, IDS_APPNAME
, 1, IDI_INFORMATION
, IDS_OKBUTTON
, 0, 0, _T("NoJumpNotFoundWarning"), IDS_MSGBOX_DONOTSHOWAGAIN
);
1836 void CLogDlg::OnBnClickedJumpDown()
1838 int jumpType
= m_JumpType
.GetCurSel();
1839 if (jumpType
< 0) return;
1844 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
1847 index
= m_LogList
.GetNextSelectedItem(pos
);
1848 if (index
== 0) return;
1850 GitRev
* data
= (GitRev
*)m_LogList
.m_arShownList
.SafeGetAt(index
);
1851 if (jumpType
== JumpType_AuthorEmail
)
1852 strValue
= data
->GetAuthorEmail();
1853 else if (jumpType
== JumpType_CommitterEmail
)
1854 strValue
= data
->GetCommitterEmail();
1855 else if (jumpType
== JumpType_Parent1
)
1857 if (data
->m_ParentHash
.size() > 0)
1858 hashValue
= data
->m_ParentHash
.at(0);
1862 else if (jumpType
== JumpType_Parent2
)
1864 if (data
->m_ParentHash
.size() > 1)
1865 hashValue
= data
->m_ParentHash
.at(1);
1869 else if (jumpType
== JumpType_TagFF
)
1870 hashValue
= data
->m_CommitHash
;
1872 m_LogList
.SetItemState(index
, 0, LVIS_SELECTED
);
1879 index
= m_LogList
.GetNextSelectedItem(pos
);
1880 m_LogList
.SetItemState(index
, 0, LVIS_SELECTED
);
1882 m_LogList
.SetSelectionMark(-1);
1884 for (int i
= index
+ 1; i
< m_LogList
.GetItemCount(); ++i
)
1887 GitRev
* data
= (GitRev
*)m_LogList
.m_arShownList
.SafeGetAt(i
);
1888 if (jumpType
== JumpType_AuthorEmail
)
1889 found
= strValue
== data
->GetAuthorEmail();
1890 else if (jumpType
== JumpType_CommitterEmail
)
1891 found
= strValue
== data
->GetCommitterEmail();
1892 else if (jumpType
== JumpType_MergePoint
)
1893 found
= data
->ParentsCount() > 1;
1894 else if (jumpType
== JumpType_Parent1
)
1895 found
= data
->m_CommitHash
== hashValue
;
1896 else if (jumpType
== JumpType_Parent2
)
1897 found
= data
->m_CommitHash
== hashValue
;
1898 else if (jumpType
== JumpType_Tag
|| jumpType
== JumpType_TagFF
)
1900 STRING_VECTOR refList
= m_LogList
.m_HashMap
[data
->m_CommitHash
];
1901 for (int j
= 0; j
< refList
.size(); ++j
)
1903 if (refList
[j
].Left(10) == _T("refs/tags/"))
1910 if (found
&& jumpType
== JumpType_TagFF
)
1911 found
= g_Git
.IsFastForward(data
->m_CommitHash
, hashValue
);
1916 m_LogList
.SetItemState(i
, LVIS_SELECTED
, LVIS_SELECTED
);
1917 m_LogList
.EnsureVisible(i
, FALSE
);
1918 m_LogList
.SetSelectionMark(i
);
1923 CMessageBox::ShowCheck(GetSafeHwnd(), IDS_PROC_LOG_JUMPNOTFOUND
, IDS_APPNAME
, 1, IDI_INFORMATION
, IDS_OKBUTTON
, 0, 0, _T("NoJumpNotFoundWarning"), IDS_MSGBOX_DONOTSHOWAGAIN
);
1926 CTGitPathList
CLogDlg::GetChangedPathsFromSelectedRevisions(bool /*bRelativePaths*/ /* = false */, bool /*bUseFilter*/ /* = true */)
1928 CTGitPathList pathList
;
1931 if (m_sRepositoryRoot
.IsEmpty() && (bRelativePaths
== false))
1933 m_sRepositoryRoot
= GetRepositoryRoot(m_path
);
1935 if (m_sRepositoryRoot
.IsEmpty() && (bRelativePaths
== false))
1938 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
1943 int nextpos
= m_LogList
.GetNextSelectedItem(pos
);
1944 if (nextpos
>= m_arShownList
.GetCount())
1946 PLOGENTRYDATA pLogEntry
= reinterpret_cast<PLOGENTRYDATA
>(m_arShownList
.SafeGetAt(nextpos
));
1947 LogChangedPathArray
* cpatharray
= pLogEntry
->pArChangedPaths
;
1948 for (INT_PTR cpPathIndex
= 0; cpPathIndex
<cpatharray
->GetCount(); ++cpPathIndex
)
1950 LogChangedPath
* cpath
= cpatharray
->SafeGetAt(cpPathIndex
);
1954 if (!bRelativePaths
)
1955 path
.SetFromGit(m_sRepositoryRoot
);
1956 path
.AppendPathString(cpath
->sPath
);
1958 ((m_cHidePaths
.GetState() & 0x0003)!=BST_CHECKED
)||
1959 (cpath
->sPath
.Left(m_sRelativeRoot
.GetLength()).Compare(m_sRelativeRoot
)==0))
1960 pathList
.AddPath(path
);
1965 pathList
.RemoveDuplicates();
1970 void CLogDlg::SortByColumn(int /*nSortColumn*/, bool /*bAscending*/)
1978 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::AscRevSort());
1980 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::DescRevSort());
1986 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::AscActionSort());
1988 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::DescActionSort());
1994 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::AscAuthorSort());
1996 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::DescAuthorSort());
2002 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::AscDateSort());
2004 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::DescDateSort());
2007 case 4: // Message or bug id
2008 if (m_bShowBugtraqColumn
)
2011 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::AscBugIDSort());
2013 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::DescBugIDSort());
2016 // fall through here
2020 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::AscMessageSort());
2022 std::sort(m_logEntries
.begin(), m_logEntries
.end(), CLogDataVector::DescMessageSort());
2032 void CLogDlg::OnLvnColumnclick(NMHDR
*pNMHDR
, LRESULT
*pResult
)
2034 if (this->IsThreadRunning())
2035 return; //no sorting while the arrays are filled
2037 LPNMLISTVIEW pNMLV
= reinterpret_cast<LPNMLISTVIEW
>(pNMHDR
);
2038 const int nColumn
= pNMLV
->iSubItem
;
2039 m_bAscending
= nColumn
== m_nSortColumn
? !m_bAscending
: TRUE
;
2040 m_nSortColumn
= nColumn
;
2041 SortByColumn(m_nSortColumn
, m_bAscending
);
2042 SetSortArrow(&m_LogList
, m_nSortColumn
, !!m_bAscending
);
2043 SortShownListArray();
2044 m_LogList
.Invalidate();
2045 UpdateLogInfoLabel();
2047 UNREFERENCED_PARAMETER(pNMHDR
);
2051 CLogOrdering orderDlg
;
2052 if (orderDlg
.DoModal() == IDOK
)
2056 void CLogDlg::SortShownListArray()
2058 // make sure the shown list still matches the filter after sorting.
2059 OnTimer(LOGFILTER_TIMER
);
2060 // clear the selection states
2061 POSITION pos
= m_LogList
.GetFirstSelectedItemPosition();
2064 m_LogList
.SetItemState(m_LogList
.GetNextSelectedItem(pos
), 0, LVIS_SELECTED
);
2066 m_LogList
.SetSelectionMark(-1);
2069 void CLogDlg::SetSortArrow(CListCtrl
* control
, int nColumn
, bool bAscending
)
2071 if (control
== NULL
)
2073 // set the sort arrow
2074 CHeaderCtrl
* pHeader
= control
->GetHeaderCtrl();
2075 HDITEM HeaderItem
= {0};
2076 HeaderItem
.mask
= HDI_FORMAT
;
2077 for (int i
=0; i
<pHeader
->GetItemCount(); ++i
)
2079 pHeader
->GetItem(i
, &HeaderItem
);
2080 HeaderItem
.fmt
&= ~(HDF_SORTDOWN
| HDF_SORTUP
);
2081 pHeader
->SetItem(i
, &HeaderItem
);
2085 pHeader
->GetItem(nColumn
, &HeaderItem
);
2086 HeaderItem
.fmt
|= (bAscending
? HDF_SORTUP
: HDF_SORTDOWN
);
2087 pHeader
->SetItem(nColumn
, &HeaderItem
);
2091 int CLogDlg::m_nSortColumnPathList
= 0;
2092 bool CLogDlg::m_bAscendingPathList
= false;
2094 void CLogDlg::OnBnClickedHidepaths()
2096 FillLogMessageCtrl();
2097 m_ChangedFileListCtrl
.Invalidate();
2100 void CLogDlg::UpdateLogInfoLabel()
2105 long selectedrevs
= 0;
2106 long selectedfiles
= 0;
2107 int count
= (int)m_LogList
.m_arShownList
.GetCount();
2111 rev1
= (reinterpret_cast<GitRev
*>(m_LogList
.m_arShownList
.SafeGetAt(0)))->m_CommitHash
;
2112 if(this->m_LogList
.m_bShowWC
&& rev1
.IsEmpty()&&(count
>1))
2114 rev1
= (reinterpret_cast<GitRev
*>(m_LogList
.m_arShownList
.SafeGetAt(start
)))->m_CommitHash
;
2115 //pLogEntry = reinterpret_cast<PLOGENTRYDATA>(m_arShownList.SafeGetAt(m_arShownList.GetCount()-1));
2116 rev2
= (reinterpret_cast<GitRev
*>(m_LogList
.m_arShownList
.SafeGetAt(count
-1)))->m_CommitHash
;
2117 selectedrevs
= m_LogList
.GetSelectedCount();
2119 selectedfiles
= m_ChangedFileListCtrl
.GetSelectedCount();
2122 sTemp
.Format(IDS_PROC_LOG_STATS
,
2124 rev2
.ToString().Left(g_Git
.GetShortHASHLength()), rev1
.ToString().Left(g_Git
.GetShortHASHLength()), selectedrevs
, selectedfiles
);
2126 if(selectedrevs
== 1)
2128 CString str
=m_ChangedFileListCtrl
.GetStatisticsString(true);
2129 str
.Replace(_T('\n'), _T(' '));
2130 sTemp
+= _T("\r\n") + str
;
2137 void CLogDlg::OnDtnDropdownDatefrom(NMHDR
* /*pNMHDR*/, LRESULT
*pResult
)
2139 // the date control should not show the "today" button
2140 CMonthCalCtrl
* pCtrl
= m_DateFrom
.GetMonthCalCtrl();
2142 SetWindowLongPtr(pCtrl
->GetSafeHwnd(), GWL_STYLE
, LONG_PTR(pCtrl
->GetStyle() | MCS_NOTODAY
));
2146 void CLogDlg::OnDtnDropdownDateto(NMHDR
* /*pNMHDR*/, LRESULT
*pResult
)
2148 // the date control should not show the "today" button
2149 CMonthCalCtrl
* pCtrl
= m_DateTo
.GetMonthCalCtrl();
2151 SetWindowLongPtr(pCtrl
->GetSafeHwnd(), GWL_STYLE
, LONG_PTR(pCtrl
->GetStyle() | MCS_NOTODAY
));
2155 void CLogDlg::OnSize(UINT nType
, int cx
, int cy
)
2157 __super::OnSize(nType
, cx
, cy
);
2162 void CLogDlg::OnRefresh()
2166 this->m_LogProgress
.SetPos(0);
2172 void CLogDlg::OnFocusFilter()
2174 GetDlgItem(IDC_SEARCHEDIT
)->SetFocus();
2177 void CLogDlg::OnEditCopy()
2179 if (GetFocus() == &m_ChangedFileListCtrl
)
2180 CopyChangedSelectionToClipBoard();
2182 m_LogList
.CopySelectionToClipBoard();
2185 CString
CLogDlg::GetAbsoluteUrlFromRelativeUrl(const CString
& url
)
2187 // is the URL a relative one?
2188 if (url
.Left(2).Compare(_T("^/")) == 0)
2190 // URL is relative to the repository root
2191 CString url1
= m_sRepositoryRoot
+ url
.Mid(1);
2192 TCHAR buf
[INTERNET_MAX_URL_LENGTH
];
2193 DWORD len
= url
.GetLength();
2194 if (UrlCanonicalize((LPCTSTR
)url1
, buf
, &len
, 0) == S_OK
)
2195 return CString(buf
, len
);
2198 else if (url
[0] == '/')
2200 // URL is relative to the server's hostname
2202 // find the server's hostname
2203 int schemepos
= m_sRepositoryRoot
.Find(_T("//"));
2206 sHost
= m_sRepositoryRoot
.Left(m_sRepositoryRoot
.Find('/', schemepos
+3));
2207 CString url1
= sHost
+ url
;
2208 TCHAR buf
[INTERNET_MAX_URL_LENGTH
];
2209 DWORD len
= url
.GetLength();
2210 if (UrlCanonicalize((LPCTSTR
)url
, buf
, &len
, 0) == S_OK
)
2211 return CString(buf
, len
);
2219 void CLogDlg::OnEnChangeSearchedit()
2222 if (m_LogList
.m_sFilterText
.IsEmpty())
2224 CStoreSelection
storeselection(this);
2225 // clear the filter, i.e. make all entries appear
2226 theApp
.DoWaitCursor(1);
2227 KillTimer(LOGFILTER_TIMER
);
2228 FillLogMessageCtrl(false);
2231 //m_LogList.StartFilter();
2233 InterlockedExchange(&m_bNoDispUpdates
, TRUE
);
2234 m_arShownList
.RemoveAll();
2235 for (DWORD i
=0; i
<m_logEntries
.size(); ++i
)
2237 if (IsEntryInDateRange(i
))
2238 m_arShownList
.Add(m_logEntries
[i
]);
2240 InterlockedExchange(&m_bNoDispUpdates
, FALSE
);
2241 m_LogList
.DeleteAllItems();
2242 m_LogList
.SetItemCountEx(ShownCountWithStopped());
2243 m_LogList
.RedrawItems(0, ShownCountWithStopped());
2244 m_LogList
.SetRedraw(false);
2245 ResizeAllListCtrlCols();
2246 m_LogList
.SetRedraw(true);
2248 theApp
.DoWaitCursor(-1);
2249 GetDlgItem(IDC_SEARCHEDIT
)->ShowWindow(SW_HIDE
);
2250 GetDlgItem(IDC_SEARCHEDIT
)->ShowWindow(SW_SHOW
);
2251 GetDlgItem(IDC_SEARCHEDIT
)->SetFocus();
2252 DialogEnableWindow(IDC_STATBUTTON
, !(((this->IsThreadRunning())||(m_LogList
.m_arShownList
.IsEmpty()))));
2255 if (Validate(m_LogList
.m_sFilterText
))
2256 SetTimer(LOGFILTER_TIMER
, 1000, NULL
);
2258 KillTimer(LOGFILTER_TIMER
);
2262 void CLogDlg::OnBnClickedAllBranch()
2266 if(this->m_bAllBranch
)
2267 m_LogList
.m_ShowMask
|=CGit::LOG_INFO_ALL_BRANCH
;
2269 m_LogList
.m_ShowMask
&=~CGit::LOG_INFO_ALL_BRANCH
;
2273 FillLogMessageCtrl(false);
2276 void CLogDlg::OnBnClickedFollowRenames()
2280 if(m_bFollowRenames
)
2282 m_LogList
.m_ShowMask
|= CGit::LOG_INFO_FOLLOW
;
2286 m_bAllBranch
= FALSE
;
2287 m_LogList
.m_ShowMask
&=~ CGit::LOG_INFO_ALL_BRANCH
;
2292 m_LogList
.m_ShowMask
&= ~CGit::LOG_INFO_FOLLOW
;
2294 DialogEnableWindow(IDC_LOG_ALLBRANCH
, !m_bFollowRenames
);
2295 DialogEnableWindow(IDC_SHOWWHOLEPROJECT
, !m_bFollowRenames
);
2299 FillLogMessageCtrl(false);
2302 void CLogDlg::OnBnClickedShowTags()
2307 m_LogList
.m_ShowRefMask
|= LOGLIST_SHOWTAGS
;
2309 m_LogList
.m_ShowRefMask
&= ~LOGLIST_SHOWTAGS
;
2311 m_LogList
.Invalidate();
2314 void CLogDlg::OnBnClickedBrowseRef()
2316 CString newRef
= CBrowseRefsDlg::PickRef(false, m_LogList
.GetRange(), gPickRef_All
, true);
2317 if(newRef
.IsEmpty())
2321 ((CButton
*)GetDlgItem(IDC_LOG_ALLBRANCH
))->SetCheck(0);
2323 OnBnClickedAllBranch();
2326 void CLogDlg::ShowStartRef()
2328 //Show ref name on top
2329 if(!::IsWindow(m_hWnd
))
2333 m_staticRef
.SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_LOG_ALLBRANCHES
)));
2334 m_staticRef
.Invalidate(TRUE
);
2335 m_tooltips
.DelTool(GetDlgItem(IDC_STATIC_REF
));
2339 CString showStartRef
= m_LogList
.GetRange();
2340 if (showStartRef
.IsEmpty() || showStartRef
== _T("HEAD"))
2342 showStartRef
.Empty();
2344 if (g_Git
.Run(L
"git symbolic-ref HEAD", &showStartRef
, NULL
, CP_UTF8
))
2345 showStartRef
= CString(MAKEINTRESOURCE(IDS_PROC_LOG_NOBRANCH
));
2346 showStartRef
.Trim(L
"\r\n\t ");
2350 showStartRef
= g_Git
.StripRefName(showStartRef
);
2352 m_staticRef
.SetWindowText(showStartRef
);
2353 CWnd
*pWnd
= GetDlgItem(IDC_STATIC_REF
);
2354 m_tooltips
.AddTool(pWnd
, showStartRef
);
2355 m_staticRef
.Invalidate(TRUE
);
2358 void CLogDlg::SetRange(const CString
& range
)
2360 m_LogList
.SetRange(range
);
2366 void CLogDlg::OnBnClickedFirstParent()
2370 if(this->m_bFirstParent
)
2371 m_LogList
.m_ShowMask
|=CGit::LOG_INFO_FIRST_PARENT
;
2373 m_LogList
.m_ShowMask
&=~CGit::LOG_INFO_FIRST_PARENT
;
2377 FillLogMessageCtrl(false);
2381 void CLogDlg::OnBnClickShowWholeProject()
2385 if(this->m_bWholeProject
)
2387 m_LogList
.m_Path
.Reset();
2389 DialogEnableWindow(IDC_LOG_FOLLOWRENAMES
, FALSE
);
2393 m_LogList
.m_Path
=m_path
;
2394 DialogEnableWindow(IDC_LOG_FOLLOWRENAMES
, !(m_path
.IsEmpty() || m_path
.IsDirectory()));
2401 FillLogMessageCtrl(false);
2405 LRESULT
CLogDlg::OnRefLogChanged(WPARAM
/*wParam*/, LPARAM
/*lParam*/)
2411 LRESULT
CLogDlg::OnTaskbarBtnCreated(WPARAM
/*wParam*/, LPARAM
/*lParam*/)
2413 m_pTaskbarList
.Release();
2414 m_pTaskbarList
.CoCreateInstance(CLSID_TaskbarList
);
2415 SetUUIDOverlayIcon(m_hWnd
);