TortoiseGit日本語言語ファイル作成
Revisión | 2412f0d54aad5e12bcd4e2d6261f0e3433ddff42 (tree) |
---|---|
Tiempo | 2010-01-23 20:53:15 |
Autor | Frank Li <lznuaa@gmai...> |
Commiter | Frank Li |
Diff file list dialog click log is okay
Signed-off-by: Frank Li <lznuaa@gmail.com>
@@ -32,6 +32,8 @@ | ||
32 | 32 | #include ".\filediffdlg.h" |
33 | 33 | #include "gitdiff.h" |
34 | 34 | #include "CommonResource.h" |
35 | +#include "BrowseRefsDlg.h" | |
36 | +#include "LogDlg.h" | |
35 | 37 | |
36 | 38 | #define ID_COMPARE 1 |
37 | 39 | #define ID_BLAME 2 |
@@ -1068,33 +1070,56 @@ bool CFileDiffDlg::SortCompare(const CTGitPath*& Data1, const CTGitPath*& Data2) | ||
1068 | 1070 | |
1069 | 1071 | void CFileDiffDlg::OnBnClickedRev1btn() |
1070 | 1072 | { |
1071 | -#if 0 | |
1072 | - if (m_bThreadRunning) | |
1073 | - return; // do nothing as long as the thread is still running | |
1073 | + | |
1074 | + ClickRevButton(&this->m_cRev1Btn,&this->m_rev1, &this->m_ctrRev1Edit); | |
1074 | 1075 | |
1075 | - // show a dialog where the user can enter a revision | |
1076 | - CRevisionDlg dlg(this); | |
1077 | - dlg.AllowWCRevs(false); | |
1078 | - *((GitRev*)&dlg) = m_rev1; | |
1076 | +} | |
1079 | 1077 | |
1080 | - if (dlg.DoModal() == IDOK) | |
1078 | +void CFileDiffDlg::ClickRevButton(CMenuButton *button, GitRev *rev, CEdit *edit) | |
1079 | +{ | |
1080 | + int entry=button->GetCurrentEntry(); | |
1081 | + if(entry == 0) /* Browse Refence*/ | |
1081 | 1082 | { |
1082 | - m_rev1 = dlg; | |
1083 | - m_cRev1Btn.SetWindowText(m_rev1.ToString()); | |
1084 | - m_cFileList.DeleteAllItems(); | |
1085 | - // start a new thread to re-fetch the diff | |
1086 | - InterlockedExchange(&m_bThreadRunning, TRUE); | |
1087 | - if (AfxBeginThread(DiffThreadEntry, this)==NULL) | |
1088 | 1083 | { |
1089 | - InterlockedExchange(&m_bThreadRunning, FALSE); | |
1090 | - CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR); | |
1084 | + CString str = CBrowseRefsDlg::PickRef(); | |
1085 | + if(str.IsEmpty()) | |
1086 | + return; | |
1087 | + | |
1088 | + if(FillRevFromString(rev,str)) | |
1089 | + return; | |
1090 | + | |
1091 | + edit->SetWindowText(str); | |
1091 | 1092 | } |
1092 | 1093 | } |
1093 | -#endif | |
1094 | + | |
1095 | + if(entry == 1) /*Log*/ | |
1096 | + { | |
1097 | + CLogDlg dlg; | |
1098 | + dlg.SetSelect(true); | |
1099 | + if(dlg.DoModal() == IDOK) | |
1100 | + { | |
1101 | + if( dlg.GetSelectedHash().IsEmpty() ) | |
1102 | + return; | |
1103 | + | |
1104 | + if(FillRevFromString(rev,dlg.GetSelectedHash())) | |
1105 | + return; | |
1106 | + | |
1107 | + edit->SetWindowText(dlg.GetSelectedHash()); | |
1108 | + | |
1109 | + }else | |
1110 | + return; | |
1111 | + } | |
1112 | + | |
1113 | + if(entry == 2) /*RefLog*/ | |
1114 | + { | |
1115 | + } | |
1116 | + | |
1117 | + SetURLLabels(); | |
1094 | 1118 | } |
1095 | 1119 | |
1096 | 1120 | void CFileDiffDlg::OnBnClickedRev2btn() |
1097 | 1121 | { |
1122 | + ClickRevButton(&this->m_cRev2Btn,&this->m_rev2, &this->m_ctrRev2Edit); | |
1098 | 1123 | #if 0 |
1099 | 1124 | if (m_bThreadRunning) |
1100 | 1125 | return; // do nothing as long as the thread is still running |
@@ -100,6 +100,23 @@ protected: | ||
100 | 100 | void SetURLLabels(); |
101 | 101 | void Filter(CString sFilterText); |
102 | 102 | void CopySelectionToClipboard(); |
103 | + | |
104 | + void ClickRevButton(CMenuButton *button,GitRev *rev, CEdit *edit); | |
105 | + | |
106 | + int FillRevFromString(GitRev *rev, CString str) | |
107 | + { | |
108 | + GitRev gitrev; | |
109 | + if(gitrev.GetCommit(str)) | |
110 | + { | |
111 | + CString msg; | |
112 | + msg.Format(_T("Reference %s is wrong"),str); | |
113 | + CMessageBox::Show(NULL,msg,_T("TortoiseGit"),MB_OK|MB_ICONERROR); | |
114 | + return -1; | |
115 | + } | |
116 | + *rev=gitrev; | |
117 | + return 0; | |
118 | + } | |
119 | + | |
103 | 120 | private: |
104 | 121 | static UINT DiffThreadEntry(LPVOID pVoid); |
105 | 122 | UINT DiffThread(); |