• R/O
  • HTTP
  • SSH
  • HTTPS

TortoiseGitJp: Commit

TortoiseGit日本語言語ファイル作成


Commit MetaInfo

Revisiona33464d77ee23f8002f1fc7c8010eb1e3c216194 (tree)
Time2010-01-24 15:22:35
AuthorFrank Li <lznuaa@gmai...>
CommiterFrank Li

Log Message

Auto List okay for Diff dialog

Signed-off-by: Frank Li <lznuaa@gmail.com>

Change Summary

Incremental Difference

--- a/src/TortoiseProc/FileDiffDlg.cpp
+++ b/src/TortoiseProc/FileDiffDlg.cpp
@@ -53,6 +53,7 @@ CFileDiffDlg::CFileDiffDlg(CWnd* pParent /*=NULL*/)
5353 m_pProgDlg(NULL),
5454 m_bCancelled(false)
5555 {
56+ m_bLoadingRef=FALSE;
5657 }
5758
5859 CFileDiffDlg::~CFileDiffDlg()
@@ -90,6 +91,7 @@ BEGIN_MESSAGE_MAP(CFileDiffDlg, CResizableStandAloneDialog)
9091 ON_WM_TIMER()
9192 ON_EN_CHANGE(IDC_REV1EDIT, &CFileDiffDlg::OnEnChangeRev1edit)
9293 ON_EN_CHANGE(IDC_REV2EDIT, &CFileDiffDlg::OnEnChangeRev2edit)
94+ ON_MESSAGE(MSG_REF_LOADED, OnRefLoad)
9395 END_MESSAGE_MAP()
9496
9597
@@ -250,6 +252,14 @@ BOOL CFileDiffDlg::OnInitDialog()
250252 CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
251253 }
252254
255+ InterlockedExchange(&m_bLoadingRef, TRUE);
256+ if (AfxBeginThread(LoadRefThreadEntry, this)==NULL)
257+ {
258+ InterlockedExchange(&m_bLoadingRef, FALSE);
259+ CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
260+ }
261+
262+
253263 this->m_cRev1Btn.AddEntry(_T("RefBrowse"));
254264 this->m_cRev1Btn.AddEntry(_T("Log"));
255265 this->m_cRev1Btn.AddEntry(_T("RefLog"));
@@ -373,7 +383,6 @@ void CFileDiffDlg::EnableInputControl(bool b)
373383 this->m_cRev2Btn.EnableWindow(b);
374384 m_cFilter.EnableWindow(b);
375385 m_SwitchButton.EnableWindow(b);
376-
377386 }
378387
379388 void CFileDiffDlg::DoDiff(int selIndex, bool blame)
@@ -668,6 +677,16 @@ void CFileDiffDlg::OnNMCustomdrawFilelist(NMHDR *pNMHDR, LRESULT *pResult)
668677 }
669678 }
670679
680+UINT CFileDiffDlg::LoadRefThread()
681+{
682+ g_Git.GetBranchList(m_Reflist,NULL,CGit::BRANCH_ALL);
683+ g_Git.GetTagList(m_Reflist);
684+
685+ this->PostMessage(MSG_REF_LOADED);
686+ InterlockedExchange(&m_bLoadingRef, FALSE);
687+ return 0;
688+}
689+
671690 void CFileDiffDlg::OnContextMenu(CWnd* pWnd, CPoint point)
672691 {
673692 if ((pWnd==0)||(pWnd != &m_cFileList))
@@ -1284,3 +1303,18 @@ void CFileDiffDlg::OnEnChangeRev2edit()
12841303
12851304 // TODO: Add your control notification handler code here
12861305 }
1306+
1307+LRESULT CFileDiffDlg::OnRefLoad(WPARAM wParam, LPARAM lParam)
1308+{
1309+ for(int i=0;i<m_Reflist.size();i++)
1310+ {
1311+ CString str=m_Reflist[i];
1312+
1313+ if(str.Find(_T("remotes/")) == 0)
1314+ str=str.Mid(8);
1315+
1316+ m_ctrRev1Edit.AddSearchString(str);
1317+ m_ctrRev2Edit.AddSearchString(str);
1318+ }
1319+ return 0;
1320+}
--- a/src/TortoiseProc/FileDiffDlg.h
+++ b/src/TortoiseProc/FileDiffDlg.h
@@ -39,6 +39,8 @@
3939 * repository. It shows a list of files/folders which were changed in those
4040 * two revisions.
4141 */
42+#define MSG_REF_LOADED (WM_USER+120)
43+
4244 class CFileDiffDlg : public CResizableStandAloneDialog
4345 {
4446 DECLARE_DYNAMIC(CFileDiffDlg)
@@ -72,6 +74,7 @@ protected:
7274 virtual void OnCancel();
7375 virtual BOOL OnInitDialog();
7476 virtual BOOL PreTranslateMessage(MSG* pMsg);
77+ afx_msg LRESULT OnRefLoad(WPARAM wParam, LPARAM lParam);
7578 afx_msg void OnNMDblclkFilelist(NMHDR *pNMHDR, LRESULT *pResult);
7679 afx_msg void OnLvnGetInfoTipFilelist(NMHDR *pNMHDR, LRESULT *pResult);
7780 afx_msg void OnNMCustomdrawFilelist(NMHDR *pNMHDR, LRESULT *pResult);
@@ -125,6 +128,15 @@ private:
125128 static UINT ExportThreadEntry(LPVOID pVoid);
126129 UINT ExportThread();
127130
131+ static UINT LoadRefThreadEntry(LPVOID pVoid)
132+ {
133+ return ((CFileDiffDlg *)pVoid)->LoadRefThread();
134+ };
135+
136+ UINT LoadRefThread();
137+
138+ STRING_VECTOR m_Reflist;
139+
128140 virtual BOOL Cancel() {return m_bCancelled;}
129141
130142 CToolTips m_tooltips;
@@ -158,6 +170,8 @@ private:
158170 bool m_bDoPegDiff;
159171 volatile LONG m_bThreadRunning;
160172
173+ volatile LONG m_bLoadingRef;
174+
161175 bool m_bCancelled;
162176
163177 void Sort();
Show on old repository browser