OSDN Git Service

Parse output at SyncDialog
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / SyncDlg.h
1 // TortoiseGit - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2008-2009 - TortoiseGit\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 \r
20 #pragma once\r
21 #include "afxcmn.h"\r
22 #include "afxwin.h"\r
23 \r
24 #include "StandAloneDlg.h"\r
25 #include "HistoryCombo.h"\r
26 #include "MenuButton.h"\r
27 #include "registry.h"\r
28 #include "Balloon.h"\r
29 #include "BranchCombox.h"\r
30 #include "GitLoglist.h"\r
31 // CSyncDlg dialog\r
32 #define IDC_SYNC_TAB 0x1000000\r
33 #define IDC_CMD_LOG             0x1\r
34 #define IDC_OUT_LOGLIST 0x2\r
35 #define IDC_OUT_CHANGELIST 0x3\r
36 class CSyncDlg : public CResizableStandAloneDialog,public CBranchCombox\r
37 {\r
38         DECLARE_DYNAMIC(CSyncDlg)\r
39 \r
40 public:\r
41         CSyncDlg(CWnd* pParent = NULL);   // standard constructor\r
42         virtual ~CSyncDlg();\r
43 \r
44 // Dialog Data\r
45         enum { IDD = IDD_SYNC };\r
46 \r
47 protected:\r
48         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
49         BRANCH_COMBOX_EVENT_HANDLE();\r
50 \r
51         CRegDWORD m_regPullButton;\r
52         CRegDWORD m_regPushButton;\r
53         CMFCTabCtrl m_ctrlTabCtrl;\r
54         CBalloon                        m_tooltips;\r
55         \r
56         BOOL            m_bInited;\r
57         \r
58         CGitLogList     m_OutLogList;\r
59         CGitLogList m_InLogList;\r
60 \r
61         CGitStatusListCtrl m_OutChangeFileList;\r
62         CGitStatusListCtrl m_InChangeFileList;\r
63         CGitStatusListCtrl m_ConflictFileList;\r
64         CRichEditCtrl      m_ctrlCmdOut;\r
65 \r
66         CTGitPathList   m_arOutChangeList;\r
67 \r
68         CWinThread*                             m_pThread;      \r
69 \r
70         void            ParserCmdOutput(TCHAR ch);\r
71 \r
72         virtual void LocalBranchChange(){FetchOutList();};\r
73         virtual void RemoteBranchChange(){FetchOutList();};\r
74 \r
75         void FetchOutList();\r
76 \r
77         bool IsURL();\r
78 \r
79         void SetRemote(CString remote)\r
80         {\r
81                 if(!remote.IsEmpty())\r
82                 {\r
83                         this->m_ctrlURL.AddString(remote);\r
84                 }\r
85         }\r
86 \r
87         std::vector<CString> m_GitCmdList;\r
88         bool m_bAbort;\r
89         int  m_GitCmdStatus;\r
90         \r
91         CString m_LogText;\r
92         CString m_OutLocalBranch;\r
93         CString m_OutRemoteBranch;\r
94         \r
95         void ShowProgressCtrl(bool bShow=true);\r
96         void ShowInputCtrl(bool bShow=true);\r
97         void SwitchToRun(){ShowProgressCtrl(true);ShowInputCtrl(false);}\r
98         void SwitchToInput(){ShowProgressCtrl(false);ShowInputCtrl(true);}\r
99         LRESULT OnProgressUpdateUI(WPARAM wParam,LPARAM lParam);\r
100 \r
101 \r
102         DECLARE_MESSAGE_MAP()\r
103 public:\r
104         BOOL m_bAutoLoadPuttyKey;\r
105         CString m_strURL;\r
106 \r
107         static UINT ProgressThreadEntry(LPVOID pVoid){ return ((CSyncDlg*)pVoid) ->ProgressThread(); };\r
108         UINT            ProgressThread();\r
109         \r
110         CHistoryCombo m_ctrlURL;\r
111         CButton m_ctrlDumyButton;\r
112         CMenuButton m_ctrlPull;\r
113         CMenuButton m_ctrlPush;\r
114         CMenuButton m_ctrlStatus;\r
115         afx_msg void OnBnClickedButtonPull();\r
116         afx_msg void OnBnClickedButtonPush();\r
117         afx_msg void OnBnClickedButtonApply();\r
118         afx_msg void OnBnClickedButtonEmail();\r
119         CProgressCtrl m_ctrlProgress;\r
120         CAnimateCtrl m_ctrlAnimate;\r
121         virtual BOOL OnInitDialog();\r
122         afx_msg void OnBnClickedButtonManage();\r
123         virtual BOOL PreTranslateMessage(MSG* pMsg);\r
124         afx_msg void OnCbenEndeditComboboxexUrl(NMHDR *pNMHDR, LRESULT *pResult);\r
125         afx_msg void OnCbnEditchangeComboboxexUrl();\r
126 \r
127         void EnableControlButton(bool bEnabled=true);\r
128 };\r