From 7a366be49296acfeb841a199ebb09785552f1c9d Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Thu, 15 May 2014 20:33:30 +0800 Subject: [PATCH] HistoryCombo show icon for git and ssh protocol Signed-off-by: Sup Yut Sum --- src/TortoiseProc/TortoiseProc.cpp | 1 + src/Utils/MiscUI/HistoryCombo.cpp | 7 +++++-- src/Utils/MiscUI/HistoryCombo.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/TortoiseProc/TortoiseProc.cpp b/src/TortoiseProc/TortoiseProc.cpp index 7eb74479b..2e012ac72 100644 --- a/src/TortoiseProc/TortoiseProc.cpp +++ b/src/TortoiseProc/TortoiseProc.cpp @@ -65,6 +65,7 @@ CTortoiseProcApp::CTortoiseProcApp() CCrashReport::Instance().AddUserInfoToReport(L"CommandLine", GetCommandLine()); EnableHtmlHelp(); SYS_IMAGE_LIST(); + CHistoryCombo::m_nGitIconIndex = SYS_IMAGE_LIST().AddIcon((HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_GITCONFIG), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE)); CHooks::Create(); m_bLoadUserToolbars = FALSE; m_bSaveState = FALSE; diff --git a/src/Utils/MiscUI/HistoryCombo.cpp b/src/Utils/MiscUI/HistoryCombo.cpp index b6558f184..71ed01913 100644 --- a/src/Utils/MiscUI/HistoryCombo.cpp +++ b/src/Utils/MiscUI/HistoryCombo.cpp @@ -1,6 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control // Copyright (C) 2003-2012 - TortoiseSVN +// Copyright (C) 2013-2014 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -26,6 +27,8 @@ #define MAX_HISTORY_ITEMS 25 +int CHistoryCombo::m_nGitIconIndex = 0; + CHistoryCombo::CHistoryCombo(BOOL bAllowSortStyle /*=FALSE*/ ) { m_nMaxHistoryItems = MAX_HISTORY_ITEMS; @@ -164,9 +167,9 @@ int CHistoryCombo::AddString(CString str, INT_PTR pos,BOOL isSel) else if (str.Left(5) == _T("file:")) cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex(); else if (str.Left(4) == _T("git:")) - cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex(); + cbei.iImage = m_nGitIconIndex; else if (str.Left(4) == _T("ssh:")) - cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex(); + cbei.iImage = m_nGitIconIndex; else cbei.iImage = SYS_IMAGE_LIST().GetDirIconIndex(); } diff --git a/src/Utils/MiscUI/HistoryCombo.h b/src/Utils/MiscUI/HistoryCombo.h index 739568638..2a320687f 100644 --- a/src/Utils/MiscUI/HistoryCombo.h +++ b/src/Utils/MiscUI/HistoryCombo.h @@ -135,6 +135,8 @@ public: int FindStringExactCaseSensitive(int nIndexStart, LPCTSTR lpszFind); + static int m_nGitIconIndex; + protected: /** * Will be called whenever the return key is pressed while the -- 2.11.4.GIT