• R/O
  • HTTP
  • SSH
  • HTTPS

TortoiseGitJp: Commit

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


Commit MetaInfo

Revision5d130c0ceb76038ab93aa7b2b89dae3f1665d91f (tree)
Time2010-01-24 19:08:44
AuthorFrank Li <lznuaa@gmai...>
CommiterFrank Li

Log Message

Diff Dialog Okay

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

Change Summary

Incremental Difference

--- a/src/TortoiseProc/FileDiffDlg.cpp
+++ b/src/TortoiseProc/FileDiffDlg.cpp
@@ -89,8 +89,7 @@ BEGIN_MESSAGE_MAP(CFileDiffDlg, CResizableStandAloneDialog)
8989 ON_MESSAGE(WM_FILTEREDIT_CANCELCLICKED, OnClickedCancelFilter)
9090 ON_EN_CHANGE(IDC_FILTER, &CFileDiffDlg::OnEnChangeFilter)
9191 ON_WM_TIMER()
92- ON_EN_CHANGE(IDC_REV1EDIT, &CFileDiffDlg::OnEnChangeRev1edit)
93- ON_EN_CHANGE(IDC_REV2EDIT, &CFileDiffDlg::OnEnChangeRev2edit)
92+ ON_MESSAGE(ENAC_UPDATE, &CFileDiffDlg::OnEnUpdate)
9493 ON_MESSAGE(MSG_REF_LOADED, OnRefLoad)
9594 END_MESSAGE_MAP()
9695
@@ -273,6 +272,8 @@ BOOL CFileDiffDlg::OnInitDialog()
273272
274273 if(m_rev2.m_CommitHash.IsEmpty())
275274 m_SwitchButton.EnableWindow(FALSE);
275+
276+ KillTimer(IDT_INPUT);
276277 return FALSE;
277278 }
278279
@@ -963,22 +964,44 @@ void CFileDiffDlg::OnBnClickedSwitchleftright()
963964
964965 }
965966
966-void CFileDiffDlg::SetURLLabels()
967+void CFileDiffDlg::SetURLLabels(int mask)
967968 {
968969
969970 // m_cRev1Btn.SetWindowText(m_rev1.m_CommitHash.ToString().Left(6));
970971 // m_cRev2Btn.SetWindowText(m_rev2.m_CommitHash.ToString().Left(6));
971972
972- SetDlgItemText(IDC_FIRSTURL, m_rev1.m_CommitHash.ToString().Left(8)+_T(": ")+m_rev1.m_Subject);
973- SetDlgItemText(IDC_SECONDURL,m_rev2.m_CommitHash.ToString().Left(8)+_T(": ")+m_rev2.m_Subject);
973+ if(mask &0x1)
974+ {
975+ SetDlgItemText(IDC_FIRSTURL, m_rev1.m_CommitHash.ToString().Left(8)+_T(": ")+m_rev1.m_Subject);
976+ m_tooltips.AddTool(IDC_FIRSTURL,
977+ CAppUtils::FormatDateAndTime( m_rev1.m_AuthorDate, DATE_SHORTDATE, false )+_T(" ")+m_rev1.m_AuthorName);
978+
979+ }
974980
975- m_tooltips.AddTool(IDC_FIRSTURL,
976- CAppUtils::FormatDateAndTime( m_rev1.m_AuthorDate, DATE_SHORTDATE, false )+_T(" ")+m_rev1.m_AuthorName);
977- m_tooltips.AddTool(IDC_SECONDURL,
978- CAppUtils::FormatDateAndTime( m_rev2.m_AuthorDate, DATE_SHORTDATE, false )+_T(" ")+m_rev2.m_AuthorName);
981+ if(mask &0x2)
982+ {
983+ SetDlgItemText(IDC_SECONDURL,m_rev2.m_CommitHash.ToString().Left(8)+_T(": ")+m_rev2.m_Subject);
984+
985+ m_tooltips.AddTool(IDC_SECONDURL,
986+ CAppUtils::FormatDateAndTime( m_rev2.m_AuthorDate, DATE_SHORTDATE, false )+_T(" ")+m_rev2.m_AuthorName);
987+ }
979988
980989 }
981990
991+void CFileDiffDlg::ClearURLabels(int mask)
992+{
993+ if(mask&0x1)
994+ {
995+ SetDlgItemText(IDC_FIRSTURL, _T(""));
996+ m_tooltips.AddTool(IDC_FIRSTURL, _T(""));
997+ }
998+
999+ if(mask&0x2)
1000+ {
1001+ SetDlgItemText(IDC_SECONDURL, _T(""));
1002+ m_tooltips.AddTool(IDC_SECONDURL, _T(""));
1003+ }
1004+}
9821005 BOOL CFileDiffDlg::PreTranslateMessage(MSG* pMsg)
9831006 {
9841007 m_tooltips.RelayEvent(pMsg);
@@ -1109,6 +1132,7 @@ void CFileDiffDlg::OnBnClickedRev1btn()
11091132 {
11101133
11111134 ClickRevButton(&this->m_cRev1Btn,&this->m_rev1, &this->m_ctrRev1Edit);
1135+
11121136
11131137 }
11141138
@@ -1170,6 +1194,7 @@ void CFileDiffDlg::ClickRevButton(CMenuButton *button, GitRev *rev, CACEdit *edi
11701194 InterlockedExchange(&m_bThreadRunning, FALSE);
11711195 CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
11721196 }
1197+ KillTimer(IDT_INPUT);
11731198 }
11741199
11751200 void CFileDiffDlg::OnBnClickedRev2btn()
@@ -1230,18 +1255,58 @@ void CFileDiffDlg::OnTimer(UINT_PTR nIDEvent)
12301255 if (m_bThreadRunning)
12311256 return;
12321257
1233- CString sFilterText;
1234- KillTimer(IDT_FILTER);
1235- m_cFilter.GetWindowText(sFilterText);
1258+ if( nIDEvent == IDT_FILTER)
1259+ {
12361260
1237- m_cFileList.SetRedraw(FALSE);
1238- m_cFileList.DeleteAllItems();
1261+ CString sFilterText;
1262+ KillTimer(IDT_FILTER);
1263+ m_cFilter.GetWindowText(sFilterText);
12391264
1240- Filter(sFilterText);
1265+ m_cFileList.SetRedraw(FALSE);
1266+ m_cFileList.DeleteAllItems();
12411267
1242- m_cFileList.SetRedraw(TRUE);
1268+ Filter(sFilterText);
1269+
1270+ m_cFileList.SetRedraw(TRUE);
1271+
1272+ __super::OnTimer(nIDEvent);
1273+ }
12431274
1244- __super::OnTimer(nIDEvent);
1275+ if( nIDEvent == IDT_INPUT)
1276+ {
1277+ KillTimer(IDT_INPUT);
1278+ TRACE(_T("Input Timer\r\n"));
1279+
1280+ GitRev gitrev;
1281+ CString str;
1282+ int mask = 0;
1283+ this->m_ctrRev1Edit.GetWindowText(str);
1284+ if( !gitrev.GetCommit(str) )
1285+ {
1286+ this->m_rev1=gitrev;
1287+ mask |= 0x1;
1288+ this->SetURLLabels(0x1);
1289+ }
1290+
1291+ this->m_ctrRev2Edit.GetWindowText(str);
1292+
1293+ if( !gitrev.GetCommit(str) )
1294+ {
1295+ this->m_rev2=gitrev;
1296+ mask |= 0x2;
1297+ this->SetURLLabels(0x2);
1298+ }
1299+
1300+ if(mask == 0x3)
1301+ {
1302+ InterlockedExchange(&m_bThreadRunning, TRUE);
1303+ if (AfxBeginThread(DiffThreadEntry, this)==NULL)
1304+ {
1305+ InterlockedExchange(&m_bThreadRunning, FALSE);
1306+ CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);
1307+ }
1308+ }
1309+ }
12451310 }
12461311
12471312 void CFileDiffDlg::Filter(CString sFilterText)
@@ -1318,3 +1383,29 @@ LRESULT CFileDiffDlg::OnRefLoad(WPARAM wParam, LPARAM lParam)
13181383 }
13191384 return 0;
13201385 }
1386+
1387+BOOL CFileDiffDlg::DestroyWindow()
1388+{
1389+ return CResizableStandAloneDialog::DestroyWindow();
1390+}
1391+
1392+LRESULT CFileDiffDlg::OnEnUpdate(WPARAM wParam, LPARAM lParam)
1393+{
1394+ if(lParam == IDC_REV1EDIT)
1395+ {
1396+ OnTextUpdate(&this->m_ctrRev1Edit);
1397+ ClearURLabels(1);
1398+ }
1399+ if(lParam == IDC_REV2EDIT)
1400+ {
1401+ OnTextUpdate(&this->m_ctrRev2Edit);
1402+ ClearURLabels(1<<1);
1403+ }
1404+ return 0;
1405+}
1406+
1407+void CFileDiffDlg::OnTextUpdate(CACEdit *pEdit)
1408+{
1409+ SetTimer(IDT_INPUT, 1000, NULL);
1410+ this->m_cFileList.ShowText(_T("Wait For input validate version"));
1411+}
\ No newline at end of file
--- a/src/TortoiseProc/FileDiffDlg.h
+++ b/src/TortoiseProc/FileDiffDlg.h
@@ -32,6 +32,7 @@
3232 #include "MenuButton.h"
3333 #include "ACEdit.h"
3434 #define IDT_FILTER 101
35+#define IDT_INPUT 102
3536
3637 /**
3738 * \ingroup TortoiseProc
@@ -87,6 +88,7 @@ protected:
8788 afx_msg void OnBnClickedRev1btn();
8889 afx_msg void OnBnClickedRev2btn();
8990 afx_msg LRESULT OnClickedCancelFilter(WPARAM wParam, LPARAM lParam);
91+ afx_msg LRESULT OnEnUpdate(WPARAM wParam, LPARAM lParam);
9092 afx_msg void OnEnChangeFilter();
9193 afx_msg void OnTimer(UINT_PTR nIDEvent);
9294
@@ -100,7 +102,8 @@ protected:
100102 int AddEntry(const CTGitPath * fd);
101103 void DoDiff(int selIndex, bool blame);
102104 void DiffProps(int selIndex);
103- void SetURLLabels();
105+ void SetURLLabels(int mask=0x3);
106+ void ClearURLabels(int mask);
104107 void Filter(CString sFilterText);
105108 void CopySelectionToClipboard();
106109
@@ -191,4 +194,6 @@ public:
191194 public:
192195 afx_msg void OnEnChangeRev1edit();
193196 afx_msg void OnEnChangeRev2edit();
197+ virtual BOOL DestroyWindow();
198+ void OnTextUpdate(CACEdit *pEdit);
194199 };
Show on old repository browser