\r
m_From=CTime(1970,1,2,0,0,0);\r
m_To=CTime::GetCurrentTime();\r
- m_bAllBranch = FALSE;\r
+ m_ShowMask = 0;\r
m_LoadingThread = NULL;\r
\r
m_bExitThread=FALSE;\r
ON_NOTIFY_REFLECT(LVN_ODFINDITEM,OnLvnOdfinditemLoglist)\r
ON_WM_CREATE()\r
ON_WM_DESTROY()\r
+ ON_MESSAGE(MSG_LOADED,OnLoad)\r
END_MESSAGE_MAP()\r
\r
int CGitLogListBase:: OnCreate(LPCREATESTRUCT lpCreateStruct)\r
case this->LOGLIST_DATE: //Date\r
if (pLogEntry)\r
lstrcpyn(pItem->pszText,\r
- CAppUtils::FormatDateAndTime( pLogEntry->m_AuthorDate, m_DateFormat ), \r
+ CAppUtils::FormatDateAndTime( pLogEntry->m_AuthorDate, m_DateFormat, true, true ), \r
pItem->cchTextMax);\r
break;\r
\r
CString hash;\r
int mask;\r
mask = CGit::LOG_INFO_ONLY_HASH | CGit::LOG_INFO_BOUNDARY;\r
- if(this->m_bAllBranch)\r
- mask |= CGit::LOG_INFO_ALL_BRANCH;\r
+// if(this->m_bAllBranch)\r
+ mask |= m_ShowMask;\r
\r
this->m_logEntries.ParserShortLog(path,hash,-1,mask);\r
\r
\r
//this->m_logEntries.ParserFromLog();\r
- SetItemCountEx(this->m_logEntries.size());\r
+ if(IsInWorkingThread())\r
+ PostMessage(LVM_SETITEMCOUNT, (WPARAM) this->m_logEntries.size(),(LPARAM) LVSICF_NOINVALIDATEALL);\r
+ else\r
+ SetItemCountEx(this->m_logEntries.size());\r
\r
this->m_arShownList.RemoveAll();\r
\r
DiffSelectedRevWithPrevious();\r
}\r
\r
-int CGitLogListBase::FetchLogAsync(CALLBACK_PROCESS *proc,void * data)\r
+int CGitLogListBase::FetchLogAsync(void * data)\r
{\r
- m_ProcCallBack=proc;\r
m_ProcData=data;\r
m_bExitThread=FALSE;\r
InterlockedExchange(&m_bThreadRunning, TRUE);\r
UINT CGitLogListBase::LogThread()\r
{\r
\r
- if(m_ProcCallBack)\r
- m_ProcCallBack(m_ProcData,GITLOG_START);\r
+// if(m_ProcCallBack)\r
+// m_ProcCallBack(m_ProcData,GITLOG_START);\r
+ ::PostMessage(this->GetParent()->m_hWnd,MSG_LOAD_PERCENTAGE,(WPARAM) GITLOG_START,0);\r
\r
InterlockedExchange(&m_bThreadRunning, TRUE);\r
InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
//disable the "Get All" button while we're receiving\r
//log messages.\r
\r
- CString temp;\r
- temp.LoadString(IDS_PROGRESSWAIT);\r
- ShowText(temp, true);\r
-\r
FillGitShortLog();\r
\r
if(this->m_bExitThread)\r
return 0;\r
-\r
+#if 0\r
RedrawItems(0, m_arShownList.GetCount());\r
// SetRedraw(false);\r
// ResizeAllListCtrlCols();\r
SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);\r
}\r
}\r
+#endif\r
InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
\r
- int index=0;\r
unsigned int updated=0;\r
int percent=0;\r
CRect rect;\r
if(!m_logEntries.FetchFullInfo(i))\r
{\r
updated++;\r
- this->GetItemRect(i,&rect,LVIR_BOUNDS);\r
- this->InvalidateRect(rect);\r
}\r
m_LogCache.AddCacheEntry(m_logEntries[i]);\r
\r
updated++;\r
InterlockedExchange(&m_logEntries[i].m_IsUpdateing,FALSE);\r
InterlockedExchange(&m_logEntries[i].m_IsFull,TRUE);\r
-\r
- this->GetItemRect(i,&rect,LVIR_BOUNDS);\r
- this->InvalidateRect(rect);\r
}\r
\r
+ ::PostMessage(m_hWnd,MSG_LOADED,(WPARAM)i,0);\r
+\r
if(m_bExitThread)\r
return 0;\r
\r
if(percent == GITLOG_END)\r
percent = GITLOG_END -1;\r
\r
- if(m_ProcCallBack)\r
- m_ProcCallBack(m_ProcData,percent);\r
+ ::PostMessage(this->GetParent()->m_hWnd,MSG_LOAD_PERCENTAGE,(WPARAM) percent,0);\r
\r
\r
}\r
// make sure the filter is applied (if any) now, after we refreshed/fetched\r
// the log messages\r
\r
- \r
-\r
- if(m_ProcCallBack)\r
- m_ProcCallBack(m_ProcData,GITLOG_END);\r
+ ::PostMessage(this->GetParent()->m_hWnd,MSG_LOAD_PERCENTAGE,(WPARAM) GITLOG_END,0);\r
\r
InterlockedExchange(&m_bThreadRunning, FALSE);\r
\r
{\r
// save the column widths to the registry\r
SaveColumnWidths();\r
+\r
+ if(this->m_bThreadRunning)\r
+ {\r
+ this->m_bExitThread=true;\r
+ DWORD ret =::WaitForSingleObject(m_LoadingThread->m_hThread,20000);\r
+ if(ret == WAIT_TIMEOUT)\r
+ TerminateThread();\r
+ }\r
while(m_LogCache.SaveCache())\r
{\r
- if(CMessageBox::Show(NULL,_T("Cannot Save Log Cache to Disk,click yes for retry, click no for give up"),_T("TortoiseGit"),\r
+ if(CMessageBox::Show(NULL,_T("Cannot Save Log Cache to Disk. To retry click yes. To give up click no."),_T("TortoiseGit"),\r
MB_YESNO) == IDNO)\r
break;\r
}\r
CHintListCtrl::OnDestroy();\r
}\r
\r
+LRESULT CGitLogListBase::OnLoad(WPARAM wParam,LPARAM lParam)\r
+{\r
+ CRect rect;\r
+ int i=(int)wParam;\r
+ this->GetItemRect(i,&rect,LVIR_BOUNDS);\r
+ this->InvalidateRect(rect);\r
+ return 0;\r
+}\r
+\r
/**\r
* Save column widths to the registry\r
*/\r
regwidth = width; // this writes it to reg\r
}\r
}\r
-}
\ No newline at end of file
+}\r