From c40f2014b66903ec11dbed28412feb2f149f505f Mon Sep 17 00:00:00 2001 From: Frank Li Date: Sat, 15 May 2010 13:43:56 +0800 Subject: [PATCH] Fixed issue #429: When applying patches, tortoise doesn't remember last file location Fix show choose repository dialog when right click at git repository Signed-off-by: Frank Li --- src/TortoiseProc/AppUtils.cpp | 7 +++++++ src/TortoiseProc/Commands/ImportPatchCommand.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index 24d4c533d..08c75e3a0 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -1972,10 +1972,16 @@ CString CAppUtils::GetClipboardLink() CString CAppUtils::ChooseRepository(CString *path) { CBrowseFolder browseFolder; + CRegString regLastResopitory = CRegString(_T("Software\\TortoiseGit\\TortoiseProc\\LastRepo"),_T("")); + browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; CString strCloneDirectory; if(path) strCloneDirectory=*path; + else + { + strCloneDirectory = regLastResopitory; + } CString title; title.LoadString(IDS_CHOOSE_REPOSITORY); @@ -1984,6 +1990,7 @@ CString CAppUtils::ChooseRepository(CString *path) if (browseFolder.Show(NULL, strCloneDirectory) == CBrowseFolder::OK) { + regLastResopitory = strCloneDirectory; return strCloneDirectory; }else diff --git a/src/TortoiseProc/Commands/ImportPatchCommand.cpp b/src/TortoiseProc/Commands/ImportPatchCommand.cpp index 66b75231e..fa996db46 100644 --- a/src/TortoiseProc/Commands/ImportPatchCommand.cpp +++ b/src/TortoiseProc/Commands/ImportPatchCommand.cpp @@ -34,9 +34,9 @@ bool ImportPatchCommand::Execute() CString cmd; CString output; - if(!this->orgCmdLinePath.HasAdminDir()) + if( orgPathList.GetCount() > 0 && !orgPathList[0].HasAdminDir()) { - CString str=CAppUtils::ChooseRepository((CString*)&orgCmdLinePath.GetWinPathString()); + CString str=CAppUtils::ChooseRepository(NULL); if(str.IsEmpty()) return FALSE; -- 2.11.4.GIT