OSDN Git Service

Git Clone Dialog Basic Okay
authorFrank Li <lznuaa@gmail.com>
Sat, 20 Dec 2008 12:14:24 +0000 (20:14 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 20 Dec 2008 12:14:24 +0000 (20:14 +0800)
src/Resources/TortoiseProcENG.rc
src/TortoiseGit.sln
src/TortoiseProc/CloneDlg.cpp
src/TortoiseProc/CloneDlg.h
src/TortoiseProc/Commands/CloneCommand.cpp
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseProc/TortoiseProc.vcproj.FSL.B20596.user
src/TortoiseProc/resource.h
src/TortoiseProc/stdafx.h
src/Utils/MiscUI/HistoryCombo.cpp
src/Utils/stdafx.h

index 99c39a6..812fd68 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 97342d5..3f87156 100644 (file)
@@ -21,6 +21,10 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hunspell", "..\ext\hunspell\hunspell.vcproj", "{12E5B4AE-D7EF-4A57-A22D-6F9F9D8CE1FB}"\r
 EndProject\r
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D2432E38-DE08-45B0-95B0-8EA06AFCBF26}"\r
+       ProjectSection(SolutionItems) = preProject\r
+               LocalTestRun.testrunconfig = LocalTestRun.testrunconfig\r
+               TortoiseGit.vsmdi = TortoiseGit.vsmdi\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "..\ext\ResizableLib\ResizableLib.vcproj", "{4BE529FB-C2F2-49F7-A897-054B955564CF}"\r
 EndProject\r
@@ -31,6 +35,9 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TSVNCache", "TGitCache\TSVNCache.vcproj", "{A00D2EDC-B4F5-4B41-94BA-13961DE5D296}"\r
 EndProject\r
 Global\r
+       GlobalSection(TestCaseManagementSettings) = postSolution\r
+               CategoryFile = TortoiseGit.vsmdi\r
+       EndGlobalSection\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                debug_static|Mixed Platforms = debug_static|Mixed Platforms\r
                debug_static|Win32 = debug_static|Win32\r
index f3d83d1..70f3243 100644 (file)
@@ -4,14 +4,16 @@
 #include "stdafx.h"\r
 #include "TortoiseProc.h"\r
 #include "CloneDlg.h"\r
-\r
+#include "BrowseFolder.h"\r
+#include "MessageBox.h"\r
 \r
 // CCloneDlg dialog\r
 \r
-IMPLEMENT_DYNCREATE(CCloneDlg, CDHtmlDialog)\r
+IMPLEMENT_DYNCREATE(CCloneDlg, CResizableStandAloneDialog)\r
 \r
 CCloneDlg::CCloneDlg(CWnd* pParent /*=NULL*/)\r
-       : CDHtmlDialog(CCloneDlg::IDD, CCloneDlg::IDH, pParent)\r
+       : CResizableStandAloneDialog(CCloneDlg::IDD, pParent)\r
+       , m_Directory(_T(""))\r
 {\r
 \r
 }\r
@@ -22,47 +24,97 @@ CCloneDlg::~CCloneDlg()
 \r
 void CCloneDlg::DoDataExchange(CDataExchange* pDX)\r
 {\r
-       CDHtmlDialog::DoDataExchange(pDX);\r
+       CResizableStandAloneDialog::DoDataExchange(pDX);\r
+       DDX_Control(pDX, IDC_URLCOMBO, m_URLCombo);\r
+       DDX_Text(pDX, IDC_CLONE_DIR, m_Directory);\r
 }\r
 \r
 BOOL CCloneDlg::OnInitDialog()\r
 {\r
-       CDHtmlDialog::OnInitDialog();\r
+       CResizableStandAloneDialog::OnInitDialog();\r
+       AddAnchor(IDC_URLCOMBO, TOP_LEFT, TOP_RIGHT);\r
+       AddAnchor(IDC_CLONE_BROWSE_URL, TOP_RIGHT);\r
+       AddAnchor(IDC_CLONE_DIR, TOP_LEFT,TOP_RIGHT);\r
+       AddAnchor(IDC_CLONE_DIR_BROWSE, TOP_RIGHT);\r
+       AddAnchor(IDOK,BOTTOM_RIGHT);\r
+       AddAnchor(IDCANCEL,BOTTOM_RIGHT);\r
+\r
+       m_URLCombo.SetURLHistory(TRUE);\r
+       m_URLCombo.LoadHistory(_T("Software\\TortoiseGit\\History\\repoURLS"), _T("url"));\r
+       if(m_URL.IsEmpty())\r
+               m_URLCombo.SetCurSel(0);\r
+       else\r
+               m_URLCombo.SetWindowTextW(m_URL);\r
+\r
+       CWnd *window=this->GetDlgItem(IDC_CLONE_DIR);\r
+       if(window)\r
+               SHAutoComplete(window->m_hWnd, SHACF_FILESYSTEM);\r
+       \r
        return TRUE;  // return TRUE  unless you set the focus to a control\r
 }\r
 \r
-BEGIN_MESSAGE_MAP(CCloneDlg, CDHtmlDialog)\r
+BEGIN_MESSAGE_MAP(CCloneDlg, CResizableStandAloneDialog)\r
        ON_BN_CLICKED(IDC_CLONE_BROWSE_URL, &CCloneDlg::OnBnClickedCloneBrowseUrl)\r
        ON_BN_CLICKED(IDC_CLONE_DIR_BROWSE, &CCloneDlg::OnBnClickedCloneDirBrowse)\r
 END_MESSAGE_MAP()\r
 \r
-BEGIN_DHTML_EVENT_MAP(CCloneDlg)\r
-       DHTML_EVENT_ONCLICK(_T("ButtonOK"), OnButtonOK)\r
-       DHTML_EVENT_ONCLICK(_T("ButtonCancel"), OnButtonCancel)\r
-END_DHTML_EVENT_MAP()\r
-\r
 \r
 \r
 // CCloneDlg message handlers\r
 \r
-HRESULT CCloneDlg::OnButtonOK(IHTMLElement* /*pElement*/)\r
+void CCloneDlg::OnOK()\r
 {\r
-       OnOK();\r
-       return S_OK;\r
+       this->m_URLCombo.GetWindowTextW(m_URL);\r
+       m_URL.Trim();\r
+       UpdateData(TRUE);\r
+       if(m_URL.IsEmpty()||m_Directory.IsEmpty())\r
+       {\r
+               CMessageBox::Show(NULL,_T("URL or Dir can't empty"),_T("TortiseGit"),MB_OK);\r
+               return;\r
+       }\r
+       m_URLCombo.SaveHistory();\r
+       CResizableDialog::OnOK();\r
+\r
 }\r
 \r
-HRESULT CCloneDlg::OnButtonCancel(IHTMLElement* /*pElement*/)\r
+void CCloneDlg::OnCancel()\r
 {\r
-       OnCancel();\r
-       return S_OK;\r
+       CResizableDialog::OnCancel();\r
 }\r
 \r
 void CCloneDlg::OnBnClickedCloneBrowseUrl()\r
 {\r
        // TODO: Add your control notification handler code here\r
+       CBrowseFolder browseFolder;\r
+       browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;\r
+       CString strCloneDirectory;\r
+       this->m_URLCombo.GetWindowTextW(strCloneDirectory);\r
+       if (browseFolder.Show(GetSafeHwnd(), strCloneDirectory) == CBrowseFolder::OK) \r
+       {\r
+               this->m_URLCombo.SetWindowTextW(strCloneDirectory);\r
+       }\r
 }\r
 \r
 void CCloneDlg::OnBnClickedCloneDirBrowse()\r
 {\r
        // TODO: Add your control notification handler code here\r
+       CBrowseFolder browseFolder;\r
+       browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;\r
+       CString strCloneDirectory = this->m_Directory;\r
+       if (browseFolder.Show(GetSafeHwnd(), strCloneDirectory) == CBrowseFolder::OK) \r
+       {\r
+               UpdateData(TRUE);\r
+               m_Directory = strCloneDirectory;\r
+               UpdateData(FALSE);\r
+       }\r
+}\r
+\r
+void CCloneDlg::OnEnChangeCloneDir()\r
+{\r
+       // TODO:  If this is a RICHEDIT control, the control will not\r
+       // send this notification unless you override the CDHtmlDialog::OnInitDialog()\r
+       // function and call CRichEditCtrl().SetEventMask()\r
+       // with the ENM_CHANGE flag ORed into the mask.\r
+\r
+       // TODO:  Add your control notification handler code here\r
 }\r
index 036a6b6..2c4f387 100644 (file)
@@ -1,12 +1,13 @@
 #pragma once\r
 \r
-#ifdef _WIN32_WCE\r
-#error "CDHtmlDialog is not supported for Windows CE."\r
-#endif \r
+#include "StandAloneDlg.h"\r
+#include "HistoryCombo.h"\r
+\r
+\r
 \r
 // CCloneDlg dialog\r
 \r
-class CCloneDlg : public CDHtmlDialog\r
+class CCloneDlg : public CResizableStandAloneDialog\r
 {\r
        DECLARE_DYNCREATE(CCloneDlg)\r
 \r
@@ -14,19 +15,23 @@ public:
        CCloneDlg(CWnd* pParent = NULL);   // standard constructor\r
        virtual ~CCloneDlg();\r
 // Overrides\r
-       HRESULT OnButtonOK(IHTMLElement *pElement);\r
-       HRESULT OnButtonCancel(IHTMLElement *pElement);\r
+       virtual void OnOK();\r
+       virtual void OnCancel();\r
 \r
 // Dialog Data\r
-       enum { IDD = IDD_CLONE, IDH = IDR_HTML_CLONEDLG };\r
+       enum { IDD = IDD_CLONE};\r
 \r
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
        virtual BOOL OnInitDialog();\r
 \r
        DECLARE_MESSAGE_MAP()\r
-       DECLARE_DHTML_EVENT_MAP()\r
+\r
 public:\r
        afx_msg void OnBnClickedCloneBrowseUrl();\r
        afx_msg void OnBnClickedCloneDirBrowse();\r
+       afx_msg void OnEnChangeCloneDir();\r
+       CString m_Directory;\r
+       CHistoryCombo   m_URLCombo;\r
+       CString m_URL;\r
 };\r
index a67b2e8..4bd2b73 100644 (file)
 #include "Hooks.h"\r
 #include "MessageBox.h"\r
 \r
+#include "CloneDlg.h"\r
+\r
 bool CloneCommand::Execute()\r
 {\r
-       return TRUE;\r
+       CCloneDlg dlg;\r
+       dlg.m_Directory=this->orgCmdLinePath.GetWinPathString();\r
+       if(dlg.DoModal()==IDOK)\r
+       {\r
+               CString dir=dlg.m_Directory;\r
+               CString url=dlg.m_URL;\r
+               CString cmd;\r
+\r
+       }\r
+       return FALSE;\r
 }\r
index 486644f..968eb88 100644 (file)
                        Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;h;hpp;hxx;hm;inl;inc"\r
                        >\r
                        <File\r
-                               RelativePath=".\CloneDlg.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\CloneDlg.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath=".\ProjectProperties.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\CloneDlg.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\CloneDlg.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\FileDiffDlg.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath=".\ProgressDlg.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ProgressDlg.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\RenameDlg.cpp"\r
                                >\r
                        </File>\r
                        </File>\r
                </Filter>\r
                <File\r
+                       RelativePath=".\ClassDiagram1.cd"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\..\..\tortoisegit\src\TortoiseProc\CloneDlg.htm"\r
+                       DeploymentContent="true"\r
+                       >\r
+               </File>\r
+               <File\r
                        RelativePath="Resource.h"\r
                        >\r
                </File>\r
index 5abd00f..6d44afa 100644 (file)
@@ -11,7 +11,7 @@
                        <DebugSettings\r
                                Command="$(TargetPath)"\r
                                WorkingDirectory="D:\Profiles\b20596\tortoisegit"\r
-                               CommandArguments="/command:revert /path:&quot;D:\Profiles\b20596\qgit4\src&quot;"\r
+                               CommandArguments="/command:clone /path:&quot;D:\test4&quot;"\r
                                Attach="false"\r
                                DebuggerType="3"\r
                                Remote="1"\r
index df0bdb5..3588b4d 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ
index d52efde..b4d57a2 100644 (file)
@@ -3,7 +3,7 @@
 // but are changed infrequently\r
 \r
 #pragma once\r
-#define XMESSAGEBOX_APPREGPATH "Software\\TortoiseSVN\\"\r
+#define XMESSAGEBOX_APPREGPATH "Software\\TortoiseGit\\"\r
 \r
 // Modify the following defines if you have to target a platform prior to the ones specified below.\r
 // Refer to MSDN for the latest info on corresponding values for different platforms.\r
@@ -40,7 +40,7 @@
 #endif // _AFX_NO_AFXCMN_SUPPORT\r
 #include <afxdlgs.h>\r
 #include <afxctl.h>\r
-#include <afxtempl.h>a\r
+#include <afxtempl.h>\r
 #include <afxmt.h>\r
 #include <afxext.h>         // MFC extensions\r
 #include <afxcontrolbars.h>     // MFC support for ribbons and control bars\r
index 135affb..98a108d 100644 (file)
@@ -21,7 +21,7 @@
 #include "../registry.h"\r
 \r
 #ifdef HISTORYCOMBO_WITH_SYSIMAGELIST\r
-#include "SysImageList.h"\r
+#include "../SysImageList.h"\r
 #endif\r
 \r
 #define MAX_HISTORY_ITEMS 25\r
@@ -117,9 +117,11 @@ int CHistoryCombo::AddString(CString str, INT_PTR pos)
                                cbei.iImage = SYS_IMAGE_LIST().GetFileIconIndex(_T(".shtml"));\r
                        else if (str.Left(5) == _T("file:"))\r
                                cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex();\r
-                       else if (str.Left(4) == _T("svn:"))\r
+                       else if (str.Left(4) == _T("git:"))\r
                                cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex();\r
-                       else if (str.Left(8) == _T("svn+ssh:"))\r
+                       else if (str.Left(4) == _T("ssh:"))\r
+                               cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex();\r
+                       else\r
                                cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex();\r
                }\r
                cbei.iSelectedImage = cbei.iImage;\r
@@ -190,7 +192,7 @@ CString CHistoryCombo::LoadHistory(LPCTSTR lpszSection, LPCTSTR lpszKeyPrefix)
        CRect rect;\r
        GetWindowRect(rect);\r
        GetParent()->ScreenToClient(rect);\r
-       MoveWindow(rect.left, rect.top, rect.Width(), 100);\r
+       MoveWindow(rect.left, rect.top, rect.Width(),100);\r
 \r
        return sText;\r
 }\r
index 9327402..747b810 100644 (file)
@@ -30,6 +30,8 @@
 #include <algorithm> \r
 #pragma warning(pop)\r
 \r
+#define USE_GDI_GRADIENT\r
+#define HISTORYCOMBO_WITH_SYSIMAGELIST\r
 \r
 #include <afxdtctl.h>          // MFC support for Internet Explorer 4 Common Controls\r
 #ifndef _AFX_NO_AFXCMN_SUPPORT\r