OSDN Git Service

Commit Dialog ViewPatch Work
authorFrank Li <lznuaa@gmail.com>
Mon, 24 Aug 2009 03:26:56 +0000 (11:26 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 24 Aug 2009 03:26:56 +0000 (11:26 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/CommitDlg.cpp
src/TortoiseProc/CommitDlg.h

index 0386943..b274db3 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index e2d4283..ee5e999 100644 (file)
@@ -1521,33 +1521,41 @@ void CCommitDlg::OnBnClickedBugtraqbutton()
        SysFreeString(temp);\r
 \r
 }\r
        SysFreeString(temp);\r
 \r
 }\r
-LRESULT CCommitDlg::OnGitStatusListCtrlItemChanged(WPARAM wparam, LPARAM lparam)\r
+\r
+void CCommitDlg::FillPatchView()\r
 {\r
 {\r
-       TRACE("OnGitStatusListCtrlItemChanged %d\r\n", wparam);\r
-       if(::IsWindow(this->m_patchViewdlg.m_hWnd))\r
+               if(::IsWindow(this->m_patchViewdlg.m_hWnd))\r
        {\r
                m_patchViewdlg.m_ctrlPatchView.SetText(CString());\r
 \r
                POSITION pos=m_ListCtrl.GetFirstSelectedItemPosition();\r
                m_patchViewdlg.m_ctrlPatchView.Call(SCI_SETREADONLY, FALSE);\r
        {\r
                m_patchViewdlg.m_ctrlPatchView.SetText(CString());\r
 \r
                POSITION pos=m_ListCtrl.GetFirstSelectedItemPosition();\r
                m_patchViewdlg.m_ctrlPatchView.Call(SCI_SETREADONLY, FALSE);\r
+               CString cmd,out;\r
+\r
                while(pos)\r
                {\r
                        int nSelect = m_ListCtrl.GetNextSelectedItem(pos);\r
                        CTGitPath * p=(CTGitPath*)m_ListCtrl.GetItemData(nSelect);\r
                while(pos)\r
                {\r
                        int nSelect = m_ListCtrl.GetNextSelectedItem(pos);\r
                        CTGitPath * p=(CTGitPath*)m_ListCtrl.GetItemData(nSelect);\r
-                       if(p)\r
+                       if(p && !(p->m_Action&CTGitPath::LOGACTIONS_UNVER) )\r
                        {\r
                        {\r
-                               CString cmd,out;\r
                                cmd.Format(_T("git.exe diff -- \"%s\""),p->GetGitPathString());\r
                                g_Git.Run(cmd,&out,CP_ACP);\r
 \r
                                cmd.Format(_T("git.exe diff -- \"%s\""),p->GetGitPathString());\r
                                g_Git.Run(cmd,&out,CP_ACP);\r
 \r
-                               m_patchViewdlg.m_ctrlPatchView.SetText(out);\r
                        }\r
 \r
                }\r
                        }\r
 \r
                }\r
+\r
+               m_patchViewdlg.m_ctrlPatchView.SetText(out);\r
                m_patchViewdlg.m_ctrlPatchView.Call(SCI_SETREADONLY, TRUE);\r
                m_patchViewdlg.m_ctrlPatchView.Call(SCI_GOTOPOS, 0);\r
 \r
        }\r
                m_patchViewdlg.m_ctrlPatchView.Call(SCI_SETREADONLY, TRUE);\r
                m_patchViewdlg.m_ctrlPatchView.Call(SCI_GOTOPOS, 0);\r
 \r
        }\r
+\r
+}\r
+LRESULT CCommitDlg::OnGitStatusListCtrlItemChanged(WPARAM wparam, LPARAM lparam)\r
+{\r
+       TRACE("OnGitStatusListCtrlItemChanged %d\r\n", wparam);\r
+       this->FillPatchView();\r
        return 0;\r
 }\r
 \r
        return 0;\r
 }\r
 \r
@@ -1764,12 +1772,15 @@ void CCommitDlg::OnStnClickedViewPatch()
                m_patchViewdlg.Create(IDD_PATCH_VIEW,this);\r
                CRect rect;\r
                this->GetWindowRect(&rect);\r
                m_patchViewdlg.Create(IDD_PATCH_VIEW,this);\r
                CRect rect;\r
                this->GetWindowRect(&rect);\r
-               rect.left=rect.right;\r
-               rect.right=rect.left+200;\r
-               m_patchViewdlg.MoveWindow(rect);\r
+               \r
+               m_patchViewdlg.SetWindowPos(NULL,rect.right,rect.top,rect.Width(),rect.Height(),\r
+                               SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);\r
+               \r
+               m_patchViewdlg.m_ctrlPatchView.MoveWindow(0,0,rect.Width(),rect.Height());\r
                m_patchViewdlg.ShowWindow(SW_SHOW);\r
                m_patchViewdlg.ShowWindow(SW_SHOW);\r
-               m_patchViewdlg.MoveWindow(rect);\r
+               \r
                ShowViewPatchText(false);\r
                ShowViewPatchText(false);\r
+               FillPatchView();\r
        }\r
        else\r
        {\r
        }\r
        else\r
        {\r
@@ -1777,6 +1788,7 @@ void CCommitDlg::OnStnClickedViewPatch()
                m_patchViewdlg.DestroyWindow();\r
                ShowViewPatchText(true);\r
        }\r
                m_patchViewdlg.DestroyWindow();\r
                ShowViewPatchText(true);\r
        }\r
+       this->m_ctrlShowPatch.Invalidate();\r
 }\r
 \r
 void CCommitDlg::OnMove(int x, int y)\r
 }\r
 \r
 void CCommitDlg::OnMove(int x, int y)\r
index c98a075..2d5e8a8 100644 (file)
@@ -67,7 +67,7 @@ private:
        static UINT StatusThreadEntry(LPVOID pVoid);\r
        UINT StatusThread();\r
        void UpdateOKButton();\r
        static UINT StatusThreadEntry(LPVOID pVoid);\r
        UINT StatusThread();\r
        void UpdateOKButton();\r
-\r
+       void FillPatchView();\r
 // Dialog Data\r
        enum { IDD = IDD_COMMITDLG };\r
 \r
 // Dialog Data\r
        enum { IDD = IDD_COMMITDLG };\r
 \r