}\r
\r
return CString(_T(""));\r
+}\r
+\r
+CString CAppUtils::ChooseRepository(CString *path)\r
+{\r
+ CBrowseFolder browseFolder;\r
+ browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;\r
+ CString strCloneDirectory;\r
+ if(path)\r
+ strCloneDirectory=*path;\r
+\r
+ CString title;\r
+ title.LoadString(IDS_CHOOSE_REPOSITORY);\r
+\r
+ browseFolder.SetInfo(title);\r
+\r
+ if (browseFolder.Show(NULL, strCloneDirectory) == CBrowseFolder::OK) \r
+ {\r
+ return strCloneDirectory;\r
+ \r
+ }else\r
+ {\r
+ return CString();\r
+ }\r
+ \r
}
\ No newline at end of file
static bool LaunchPAgent(CString *keyfile=NULL,CString * pRemote=NULL);\r
\r
static CString GetClipboardLink();\r
+ static CString ChooseRepository(CString *path);\r
\r
private:\r
static CString PickDiffTool(const CTGitPath& file1, const CTGitPath& file2);\r
#include "Git.h"\r
#include "DirFileEnum.h"\r
#include "ShellUpdater.h"\r
+#include "AppUtils.h"\r
\r
bool ImportPatchCommand::Execute()\r
{\r
CString cmd;\r
CString output;\r
\r
+ if(!this->orgCmdLinePath.IsAdminDir())\r
+ {\r
+ CString str=CAppUtils::ChooseRepository((CString*)&orgCmdLinePath.GetWinPathString());\r
+ CTGitPath path;\r
+ path.SetFromWin(str);\r
+ \r
+ if(!path.HasAdminDir())\r
+ {\r
+ CString format;\r
+ format.LoadString(IDS_ERR_NOT_REPOSITORY);\r
+ CString err;\r
+ err.Format(format,str);\r
+ CMessageBox::Show(NULL,err,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ return FALSE;\r
+ }\r
+ g_Git.m_CurrentDir=str;\r
+ }\r
+\r
for(int i=0;i<this->pathList.GetCount();i++)\r
{\r
if(!pathList[i].IsDirectory())\r
#include "stdafx.h"\r
#include "TortoiseProc.h"\r
#include "ImportPatchDlg.h"\r
-\r
+#include "git.h"\r
\r
// CImportPatchDlg dialog\r
\r
\r
//CAppUtils::SetListCtrlBackgroundImage(m_cList.GetSafeHwnd(), nID);\r
\r
+ CString title;\r
+ this->GetWindowText(title);\r
+ this->SetWindowText(title+_T(" - ")+g_Git.m_CurrentDir);\r
EnableSaveRestore(_T("ImportDlg"));\r
\r
return TRUE;\r