OSDN Git Service

Merge From Colin Law Save and restore column widths for log and blame in registry
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / GitLogListBase.h
index 9548b9b..c37f92b 100644 (file)
@@ -2,7 +2,7 @@
 \r
 #include "HintListCtrl.h"\r
 #include "XPTheme.h"\r
-#include "resource.h"\r
+#include "CommonResource.h"\r
 #include "Git.h"\r
 #include "ProjectProperties.h"\r
 #include "TGitPath.h"\r
@@ -17,7 +17,7 @@
 #include "HintListCtrl.h"\r
 //#include "GitLogList.h"\r
 #include "lanes.h"\r
-\r
+#include "GitLogCache.h"\r
 #include <regex>\r
 // CGitLogList\r
 #if (NTDDI_VERSION < NTDDI_LONGHORN)\r
@@ -53,7 +53,9 @@ enum LISTITEMSTATES_MINE {
 #define LOGFILTER_REGEX           6\r
 #define LOGFILTER_BUGID    7\r
 \r
-typedef void CALLBACK_PROCESS(void * data, int progress);\r
+//typedef void CALLBACK_PROCESS(void * data, int progress);\r
+#define MSG_LOADED                             (WM_USER+110)\r
+#define MSG_LOAD_PERCENTAGE            (WM_USER+111)\r
 \r
 class CGitLogListBase : public CHintListCtrl\r
 {\r
@@ -71,6 +73,7 @@ public:
        bool                            m_hasWC;\r
        GitRev                          m_wcRev;\r
        volatile LONG           m_bThreadRunning;\r
+       CLogCache                       m_LogCache;\r
 \r
        enum\r
        {\r
@@ -123,7 +126,8 @@ public:
        ID_CHERRY_PICK,\r
        ID_CREATE_BRANCH,\r
        ID_CREATE_TAG,\r
-       ID_SWITCHTOREV\r
+       ID_SWITCHTOREV,\r
+       ID_RESET\r
        };\r
        void InsertGitColumn();\r
        void ResizeAllListCtrlCols();\r
@@ -134,10 +138,11 @@ public:
        int  FillGitLog(CTGitPath *path,int infomask=CGit::     LOG_INFO_STAT| CGit::LOG_INFO_FILESTATE);\r
 \r
        inline int ShownCountWithStopped() const { return (int)m_arShownList.GetCount() + (m_bStrictStopped ? 1 : 0); }\r
-       int FetchLogAsync(CALLBACK_PROCESS *proc=NULL, void * data=NULL);\r
+       int FetchLogAsync(void * data=NULL);\r
        CPtrArray                       m_arShownList;\r
        void Refresh();\r
        void RecalculateShownList(CPtrArray * pShownlist);\r
+       void Clear();\r
 \r
        int                                     m_nSelectedFilter;\r
        CLogDataVector          m_logEntries;\r
@@ -147,19 +152,39 @@ public:
        CString                         m_sFilterText;\r
        CTime                   m_From;\r
        CTime                   m_To;\r
+    \r
+    CTGitPath           m_Path;\r
+    BOOL           m_bAllBranch;\r
+\r
        void                            GetTimeRange(CTime &oldest,CTime &latest);\r
        virtual void ContextMenuAction(int cmd,int FirstSelect, int LastSelect)=0;\r
        void ReloadHashMap()\r
        {       \r
                m_HashMap.clear();\r
                g_Git.GetMapHashToFriendName(m_HashMap);\r
+               m_CurrentBranch=g_Git.GetCurrentBranch();\r
+       }\r
+       void TerminateThread()\r
+       {\r
+               if(this->m_LoadingThread)\r
+                       AfxTermThread((HINSTANCE)m_LoadingThread->m_hThread);\r
+       };\r
+\r
+       bool IsInWorkingThread()\r
+       {\r
+               return (AfxGetThread() == m_LoadingThread);\r
        }\r
+       \r
+       volatile bool           m_bExitThread;\r
+       CWinThread*                     m_LoadingThread;\r
 protected:\r
        DECLARE_MESSAGE_MAP()\r
+       afx_msg void OnDestroy();\r
        afx_msg void OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult);\r
        afx_msg void OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult);\r
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);\r
        afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);\r
+       afx_msg LRESULT OnLoad(WPARAM wParam, LPARAM lParam);\r
        void OnNMDblclkLoglist(NMHDR * /*pNMHDR*/, LRESULT *pResult);\r
        afx_msg void OnLvnOdfinditemLoglist(NMHDR *pNMHDR, LRESULT *pResult);\r
        void PreSubclassWindow();\r
@@ -174,7 +199,10 @@ protected:
        void paintGraphLane(HDC hdc,int laneHeight, int type, int x1, int x2,\r
                                       const COLORREF& col,int top) ; \r
        void DrawLine(HDC hdc, int x1, int y1, int x2, int y2){::MoveToEx(hdc,x1,y1,NULL);::LineTo(hdc,x2,y2);}\r
-\r
+       /**\r
+       * Save column widths to the registry\r
+       */\r
+       void SaveColumnWidths();        // save col widths to the registry\r
 \r
        BOOL IsEntryInDateRange(int i);\r
 \r
@@ -196,10 +224,16 @@ protected:
        CRegDWORD                       m_regMaxBugIDColWidth;\r
        int                                     m_nSearchIndex;\r
        \r
-       CALLBACK_PROCESS    *m_ProcCallBack;\r
        void                            *m_ProcData;\r
        CStoreSelection*        m_pStoreSelection;\r
        MAP_HASH_NAME           m_HashMap;\r
+\r
+       CColors                         m_Colors;\r
+\r
+       CString                         m_CurrentBranch;\r
+       \r
+       COLORREF                        m_LineColors[Lanes::COLORS_NUM];\r
+       DWORD                           m_DateFormat;   // DATE_SHORTDATE or DATE_LONGDATE\r
 };\r
 \r
 \r