--- /dev/null
+// BrowseRefsDlg.cpp : implementation file\r
+//\r
+\r
+#include "stdafx.h"\r
+#include "TortoiseProc.h"\r
+#include "BrowseRefsDlg.h"\r
+\r
+\r
+// CBrowseRefsDlg dialog\r
+\r
+IMPLEMENT_DYNAMIC(CBrowseRefsDlg, CDialog)\r
+\r
+CBrowseRefsDlg::CBrowseRefsDlg(CWnd* pParent /*=NULL*/)\r
+ : CDialog(CBrowseRefsDlg::IDD, pParent)\r
+{\r
+\r
+}\r
+\r
+CBrowseRefsDlg::~CBrowseRefsDlg()\r
+{\r
+}\r
+\r
+void CBrowseRefsDlg::DoDataExchange(CDataExchange* pDX)\r
+{\r
+ CDialog::DoDataExchange(pDX);\r
+ DDX_Control(pDX, IDC_TREE_REF, m_RefTreeCtrl);\r
+}\r
+\r
+\r
+BEGIN_MESSAGE_MAP(CBrowseRefsDlg, CDialog)\r
+ ON_BN_CLICKED(IDOK, &CBrowseRefsDlg::OnBnClickedOk)\r
+END_MESSAGE_MAP()\r
+\r
+\r
+// CBrowseRefsDlg message handlers\r
+\r
+void CBrowseRefsDlg::OnBnClickedOk()\r
+{\r
+ OnOK();\r
+}\r
+\r
+BOOL CBrowseRefsDlg::OnInitDialog()\r
+{\r
+ CDialog::OnInitDialog();\r
+\r
+ Refresh();\r
+\r
+\r
+ return TRUE; // return TRUE unless you set the focus to a control\r
+ // EXCEPTION: OCX Property Pages should return FALSE\r
+}\r
+\r
+CShadowTree* CShadowTree::GetNextSub(CString& nameLeft)\r
+{\r
+ int posSlash=nameLeft.Find('/');\r
+ CString nameSub;\r
+ if(posSlash<0)\r
+ {\r
+ nameSub=nameLeft;\r
+ nameLeft.Empty();//Nothing left\r
+ }\r
+ else\r
+ {\r
+ nameSub=nameLeft.Left(posSlash);\r
+ nameLeft=nameLeft.Mid(posSlash+1);\r
+ }\r
+ if(nameSub.IsEmpty())\r
+ return NULL;\r
+\r
+ CShadowTree& nextNode=m_ShadowTree[nameSub];\r
+ nextNode.m_csName=nameSub;\r
+ nextNode.m_pParent=this;\r
+ return &nextNode;\r
+}\r
+\r
+typedef std::map<CString,CString> MAP_STRING_STRING;\r
+\r
+void CBrowseRefsDlg::Refresh()\r
+{\r
+ m_RefMap.clear();\r
+ g_Git.GetMapHashToFriendName(m_RefMap);\r
+\r
+ m_RefTreeCtrl.DeleteAllItems();\r
+ m_TreeRoot.m_ShadowTree.clear();\r
+ m_TreeRoot.m_csName="Refs";\r
+ m_TreeRoot.m_hTree=m_RefTreeCtrl.InsertItem(L"Refs",NULL,NULL);\r
+ m_RefTreeCtrl.SetItemData(m_TreeRoot.m_hTree,(DWORD_PTR)&m_TreeRoot);\r
+\r
+\r
+ MAP_STRING_STRING refName;\r
+\r
+ //First sort on ref name\r
+ for(MAP_HASH_NAME::iterator iterRef=m_RefMap.begin();iterRef!=m_RefMap.end();++iterRef)\r
+ for(STRING_VECTOR::iterator iterRefName=iterRef->second.begin();iterRefName!=iterRef->second.end();++iterRefName)\r
+ refName[*iterRefName]=iterRef->first;\r
+\r
+ //Populate ref tree\r
+ for(MAP_STRING_STRING::iterator iterRefName=refName.begin();iterRefName!=refName.end();++iterRefName)\r
+ {\r
+ CShadowTree& treeLeaf=GetTreeNode(iterRefName->first);\r
+ treeLeaf.m_csRef=iterRefName->second;\r
+ }\r
+\r
+ m_RefTreeCtrl.Expand(m_TreeRoot.m_hTree,TVE_EXPAND);\r
+\r
+}\r
+\r
+CShadowTree& CBrowseRefsDlg::GetTreeNode(CString refName, CShadowTree* pTreePos)\r
+{\r
+ if(pTreePos==NULL)\r
+ {\r
+ if(wcsnicmp(refName,L"refs/",5)==0)\r
+ refName=refName.Mid(5);\r
+ pTreePos=&m_TreeRoot;\r
+ }\r
+ if(refName.IsEmpty())\r
+ return *pTreePos;//Found leaf\r
+\r
+ CShadowTree* pNextTree=pTreePos->GetNextSub(refName);\r
+ if(pNextTree==NULL)\r
+ {\r
+ //Should not occur when all ref-names are valid.\r
+ ASSERT(FALSE);\r
+ return *pTreePos;\r
+ }\r
+ if(pNextTree->m_hTree==NULL)\r
+ {\r
+ //New tree. Create node in control.\r
+ pNextTree->m_hTree=m_RefTreeCtrl.InsertItem(pNextTree->m_csName,pTreePos->m_hTree,NULL);\r
+ m_RefTreeCtrl.SetItemData(pNextTree->m_hTree,(DWORD_PTR)pNextTree);\r
+ }\r
+\r
+ return GetTreeNode(refName,pNextTree);\r
+}\r
+\r
<?xml version="1.0" encoding="Windows-1252"?>\r
<VisualStudioProject\r
ProjectType="Visual C++"\r
- Version="9.00"\r
+ Version="9,00"\r
Name="TortoiseProc"\r
ProjectGUID="{50797F06-39C5-4802-8E2B-7B7A4EF03214}"\r
RootNamespace="TortoiseProc"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Debug|x64"\r
- OutputDirectory="..\..\bin\Debug64\bin"\r
- IntermediateDirectory="..\..\obj\TortoiseProc\Debug64"\r
+ Name="Release|Win32"\r
+ OutputDirectory="..\..\bin\$(ConfigurationName)\bin"\r
+ IntermediateDirectory="..\..\obj\TortoiseProc\$(ConfigurationName)"\r
ConfigurationType="1"\r
UseOfMFC="2"\r
- UseOfATL="0"\r
CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
- PreprocessorDefinitions="_DEBUG"\r
+ PreprocessorDefinitions="NDEBUG"\r
MkTypLibCompatible="false"\r
- TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="0"\r
AdditionalIncludeDirectories="..\TortoiseProc;..\Resources;"$InputDir";../../ext/ResizableLib;../Git;"../../ext/apr-util/include";"../../ext/apr-util/xml/expat/lib";../../ext/Subversion/subversion/include;../../ext/Subversion/subversion/libsvn_client;../../ext/apr/include;../../ext/boost;..\Utils;..\SVN;..\..\ext\ResizableLib;..\crashrpt;"..\..\ext\libintl\libintl3-win32\inc";..\..\ext\hunspell;..\..\ext\scintilla\include;..\Utils\TreePropSheet;..\Utils\ColourPickerXP;..\Utils\NewMenu;..\Utils\MiscUI;..\LogCache;"../../ext/cyrus-sasl/include";../../../common/openssl/inc32;.\RevisionGraph;..\TortoiseShell"\r
- PreprocessorDefinitions="WIN64;_WINDOWS;_DEBUG;SVN_DEBUG;ENABLE_NLS;THESAURUS"\r
- MinimalRebuild="true"\r
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;THESAURUS"\r
+ StringPooling="true"\r
+ MinimalRebuild="false"\r
ExceptionHandling="2"\r
- RuntimeLibrary="3"\r
+ RuntimeLibrary="2"\r
+ BufferSecurityCheck="false"\r
TreatWChar_tAsBuiltInType="true"\r
ForceConformanceInForLoopScope="true"\r
RuntimeTypeInfo="true"\r
UsePrecompiledHeader="2"\r
WarningLevel="4"\r
DebugInformationFormat="3"\r
+ DisableSpecificWarnings="4996,4018"\r
/>\r
<Tool\r
Name="VCManagedResourceCompilerTool"\r
/>\r
<Tool\r
Name="VCResourceCompilerTool"\r
- PreprocessorDefinitions="_DEBUG"\r
+ PreprocessorDefinitions="NDEBUG"\r
Culture="1033"\r
AdditionalIncludeDirectories=""$(IntDir)";..\TortoiseShell"\r
/>\r
<Tool\r
Name="VCLinkerTool"\r
AdditionalDependencies="Crypt32.lib gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib Dnsapi.lib"\r
- LinkIncremental="2"\r
+ LinkIncremental="1"\r
+ AdditionalLibraryDirectories="../../ext/wingit"\r
IgnoreDefaultLibraryNames=""\r
DelayLoadDLLs="gdiplus.dll"\r
GenerateDebugInformation="true"\r
SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ OptimizeForWindows98="0"\r
RandomizedBaseAddress="1"\r
DataExecutionPrevention="0"\r
- TargetMachine="17"\r
+ TargetMachine="1"\r
+ Profile="true"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Release|Win32"\r
- OutputDirectory="..\..\bin\$(ConfigurationName)\bin"\r
- IntermediateDirectory="..\..\obj\TortoiseProc\$(ConfigurationName)"\r
+ Name="Debug|x64"\r
+ OutputDirectory="..\..\bin\Debug64\bin"\r
+ IntermediateDirectory="..\..\obj\TortoiseProc\Debug64"\r
ConfigurationType="1"\r
UseOfMFC="2"\r
+ UseOfATL="0"\r
CharacterSet="1"\r
- WholeProgramOptimization="1"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
- PreprocessorDefinitions="NDEBUG"\r
+ PreprocessorDefinitions="_DEBUG"\r
MkTypLibCompatible="false"\r
+ TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
+ Optimization="0"\r
AdditionalIncludeDirectories="..\TortoiseProc;..\Resources;"$InputDir";../../ext/ResizableLib;../Git;"../../ext/apr-util/include";"../../ext/apr-util/xml/expat/lib";../../ext/Subversion/subversion/include;../../ext/Subversion/subversion/libsvn_client;../../ext/apr/include;../../ext/boost;..\Utils;..\SVN;..\..\ext\ResizableLib;..\crashrpt;"..\..\ext\libintl\libintl3-win32\inc";..\..\ext\hunspell;..\..\ext\scintilla\include;..\Utils\TreePropSheet;..\Utils\ColourPickerXP;..\Utils\NewMenu;..\Utils\MiscUI;..\LogCache;"../../ext/cyrus-sasl/include";../../../common/openssl/inc32;.\RevisionGraph;..\TortoiseShell"\r
- PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;THESAURUS"\r
- StringPooling="true"\r
- MinimalRebuild="false"\r
+ PreprocessorDefinitions="WIN64;_WINDOWS;_DEBUG;SVN_DEBUG;ENABLE_NLS;THESAURUS"\r
+ MinimalRebuild="true"\r
ExceptionHandling="2"\r
- RuntimeLibrary="2"\r
- BufferSecurityCheck="false"\r
+ RuntimeLibrary="3"\r
TreatWChar_tAsBuiltInType="true"\r
ForceConformanceInForLoopScope="true"\r
RuntimeTypeInfo="true"\r
UsePrecompiledHeader="2"\r
WarningLevel="4"\r
DebugInformationFormat="3"\r
- DisableSpecificWarnings="4996,4018"\r
/>\r
<Tool\r
Name="VCManagedResourceCompilerTool"\r
/>\r
<Tool\r
Name="VCResourceCompilerTool"\r
- PreprocessorDefinitions="NDEBUG"\r
+ PreprocessorDefinitions="_DEBUG"\r
Culture="1033"\r
AdditionalIncludeDirectories=""$(IntDir)";..\TortoiseShell"\r
/>\r
<Tool\r
Name="VCLinkerTool"\r
AdditionalDependencies="Crypt32.lib gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib Dnsapi.lib"\r
- LinkIncremental="1"\r
- AdditionalLibraryDirectories="../../ext/wingit"\r
+ LinkIncremental="2"\r
IgnoreDefaultLibraryNames=""\r
DelayLoadDLLs="gdiplus.dll"\r
GenerateDebugInformation="true"\r
SubSystem="2"\r
- OptimizeReferences="2"\r
- EnableCOMDATFolding="2"\r
- OptimizeForWindows98="0"\r
RandomizedBaseAddress="1"\r
DataExecutionPrevention="0"\r
- TargetMachine="1"\r
- Profile="true"\r
+ TargetMachine="17"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;h;hpp;hxx;hm;inl;inc"\r
>\r
<File\r
+ RelativePath=".\BrowseRefsDlg.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\BrowseRefsDlg.h"\r
+ >\r
+ </File>\r
+ <File\r
RelativePath="..\TGitCache\CacheInterface.cpp"\r
>\r
</File>\r
>\r
</File>\r
<File\r
- RelativePath=".\copy.ico"\r
+ RelativePath="..\Resources\copy.ico"\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\copy.ico"\r
+ RelativePath=".\copy.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\explorer.ico"\r
+ RelativePath=".\explorer.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\explorer.ico"\r
+ RelativePath="..\Resources\explorer.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath=".\newfolder.ico"\r
+ RelativePath="..\Resources\newfolder.ico"\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\newfolder.ico"\r
+ RelativePath=".\newfolder.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath=".\refresh.ico"\r
+ RelativePath="..\Resources\refresh.ico"\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\refresh.ico"\r
+ RelativePath=".\refresh.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\save.ico"\r
+ RelativePath=".\save.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\save.ico"\r
+ RelativePath="..\Resources\save.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath=".\up.ico"\r
+ RelativePath="..\Resources\up.ico"\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\up.ico"\r
+ RelativePath=".\up.ico"\r
>\r
</File>\r
<File\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
<Global\r
Name="RESOURCE_FILE"\r
- Value="\TortoiseGit\src\Resources\TortoiseProcENG.rc"\r
+ Value="\Develop\TortoiseGit\src\Resources\TortoiseProcENG.rc"\r
/>\r
</Globals>\r
</VisualStudioProject>\r