OSDN Git Service

Pick Ref: Change [...] button in log dialog in a clickable ref name
authorJohan 't Hart <johanthart@gmail.com>
Wed, 3 Jun 2009 22:19:50 +0000 (00:19 +0200)
committerFrank Li <lznuaa@gmail.com>
Thu, 4 Jun 2009 01:07:52 +0000 (09:07 +0800)
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/LogDlg.cpp
src/TortoiseProc/LogDlg.h
src/TortoiseProc/resource.h

index f10231f..a7063aa 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 35276ce..a6e662e 100644 (file)
@@ -108,6 +108,7 @@ void CLogDlg::DoDataExchange(CDataExchange* pDX)
        DDX_Check(pDX, IDC_LOG_ALLBRANCH,m_bAllBranch);\r
        DDX_Check(pDX, IDC_SHOWWHOLEPROJECT,m_bWholeProject);\r
        DDX_Control(pDX, IDC_SEARCHEDIT, m_cFilter);\r
+       DDX_Control(pDX, IDC_STATIC_REF, m_staticRef);\r
 }\r
 \r
 BEGIN_MESSAGE_MAP(CLogDlg, CResizableStandAloneDialog)\r
@@ -144,7 +145,8 @@ BEGIN_MESSAGE_MAP(CLogDlg, CResizableStandAloneDialog)
        ON_WM_SIZE()\r
        ON_BN_CLICKED(IDC_LOG_FIRSTPARENT, &CLogDlg::OnBnClickedFirstParent)\r
        ON_BN_CLICKED(IDC_REFRESH, &CLogDlg::OnBnClickedRefresh)\r
-       ON_BN_CLICKED(IDC_BUTTON_BROWSE_REF, &CLogDlg::OnBnClickedBrowseRef)\r
+//     ON_BN_CLICKED(IDC_BUTTON_BROWSE_REF, &CLogDlg::OnBnClickedBrowseRef)\r
+       ON_STN_CLICKED(IDC_STATIC_REF, &CLogDlg::OnBnClickedBrowseRef)\r
        ON_COMMAND(ID_LOGDLG_REFRESH,&CLogDlg::OnRefresh)\r
        ON_COMMAND(ID_LOGDLG_FIND,&CLogDlg::OnFind)\r
        ON_COMMAND(ID_LOGDLG_FOCUSFILTER,&CLogDlg::OnFocusFilter)\r
@@ -236,9 +238,11 @@ BOOL CLogDlg::OnInitDialog()
        m_DateFrom.SendMessage(DTM_SETMCSTYLE, 0, MCS_WEEKNUMBERS|MCS_NOTODAY|MCS_NOTRAILINGDATES|MCS_NOSELCHANGEONNAV);\r
        m_DateTo.SendMessage(DTM_SETMCSTYLE, 0, MCS_WEEKNUMBERS|MCS_NOTODAY|MCS_NOTRAILINGDATES|MCS_NOSELCHANGEONNAV);\r
 \r
+       m_staticRef.SetURL(CString());\r
+\r
        // resizable stuff\r
        AddAnchor(IDC_STATIC_REF, TOP_LEFT);\r
-       AddAnchor(IDC_BUTTON_BROWSE_REF, TOP_LEFT);\r
+       //AddAnchor(IDC_BUTTON_BROWSE_REF, TOP_LEFT);\r
        AddAnchor(IDC_FROMLABEL, TOP_LEFT);\r
        AddAnchor(IDC_DATEFROM, TOP_LEFT);\r
        AddAnchor(IDC_TOLABEL, TOP_LEFT);\r
@@ -3074,7 +3078,8 @@ void CLogDlg::ShowStartRef()
                return;\r
        if(m_bAllBranch)\r
        {\r
-               GetDlgItem(IDC_STATIC_REF)->SetWindowText(L"<All Branches>");\r
+               m_staticRef.SetWindowText(L"<All Branches>");\r
+               m_staticRef.Invalidate(TRUE);\r
                return;\r
        }\r
 \r
@@ -3092,7 +3097,8 @@ void CLogDlg::ShowStartRef()
        if(wcsncmp(showStartRef,L"heads/",6) == 0)\r
                showStartRef = showStartRef.Mid(6);\r
 \r
-       GetDlgItem(IDC_STATIC_REF)->SetWindowText(showStartRef);\r
+       m_staticRef.SetWindowText(showStartRef);\r
+       m_staticRef.Invalidate(TRUE);\r
 }\r
 \r
 void CLogDlg::SetStartRef(const CString& StartRef)\r
index 37883ee..742d254 100644 (file)
@@ -35,6 +35,7 @@
 #include <regex>\r
 #include "GitLogList.h"\r
 #include "GitStatusListCtrl.h"\r
+#include "HyperLink.h"\r
 \r
 using namespace std;\r
 \r
@@ -224,6 +225,7 @@ private:
        CGitLogList                     m_LogList;\r
        CGitStatusListCtrl  m_ChangedFileListCtrl;\r
        CFilterEdit                     m_cFilter;\r
+       CHyperLink                      m_staticRef;\r
        CProgressCtrl           m_LogProgress;\r
        CMenuButton                     m_btnShow;\r
        CMenuButton                     m_btnShowWholeProject;\r
index e50ec80..bf74599 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ