From 8da4bbba37ba580317332ea087a0079ee5a182a8 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Sat, 24 Apr 2010 13:10:05 +0800 Subject: [PATCH] SyncDlg Improve user experience when input remote branch and url Signed-off-by: Frank Li --- src/TortoiseProc/SyncDlg.cpp | 21 ++++++++++++++++++--- src/TortoiseProc/SyncDlg.h | 6 +++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/TortoiseProc/SyncDlg.cpp b/src/TortoiseProc/SyncDlg.cpp index d1b3c4e00..caeb1c349 100644 --- a/src/TortoiseProc/SyncDlg.cpp +++ b/src/TortoiseProc/SyncDlg.cpp @@ -73,10 +73,12 @@ BEGIN_MESSAGE_MAP(CSyncDlg, CResizableStandAloneDialog) ON_BN_CLICKED(IDC_BUTTON_MANAGE, &CSyncDlg::OnBnClickedButtonManage) BRANCH_COMBOX_EVENT ON_NOTIFY(CBEN_ENDEDIT, IDC_COMBOBOXEX_URL, &CSyncDlg::OnCbenEndeditComboboxexUrl) - ON_CBN_EDITCHANGE(IDC_COMBOBOXEX_URL, &CSyncDlg::OnCbnEditchangeComboboxexUrl) + ON_CBN_EDITCHANGE(IDC_COMBOBOXEX_URL, &CSyncDlg::OnCbnEditchangeComboboxex) + ON_CBN_EDITCHANGE(IDC_COMBOBOXEX_REMOTE_BRANCH, &CSyncDlg::OnCbnEditchangeComboboxex) ON_MESSAGE(MSG_PROGRESSDLG_UPDATE_UI, OnProgressUpdateUI) ON_BN_CLICKED(IDC_BUTTON_COMMIT, &CSyncDlg::OnBnClickedButtonCommit) ON_BN_CLICKED(IDC_BUTTON_SUBMODULE, &CSyncDlg::OnBnClickedButtonSubmodule) + ON_WM_TIMER() END_MESSAGE_MAP() @@ -866,9 +868,12 @@ void CSyncDlg::OnCbenEndeditComboboxexUrl(NMHDR *pNMHDR, LRESULT *pResult) *pResult = 0; } -void CSyncDlg::OnCbnEditchangeComboboxexUrl() +void CSyncDlg::OnCbnEditchangeComboboxex() { - this->FetchOutList(); + SetTimer(IDT_INPUT, 1000, NULL); + this->m_OutLogList.ShowText(_T("Wait for input")); + + //this->FetchOutList(); // TODO: Add your control notification handler code here } @@ -1005,3 +1010,13 @@ void CSyncDlg::OnBnClickedButtonSubmodule() } } + + +void CSyncDlg::OnTimer(UINT_PTR nIDEvent) +{ + if( nIDEvent == IDT_INPUT) + { + KillTimer(IDT_INPUT); + this->FetchOutList(true); + } +} \ No newline at end of file diff --git a/src/TortoiseProc/SyncDlg.h b/src/TortoiseProc/SyncDlg.h index eebf3c10a..7339f77e2 100644 --- a/src/TortoiseProc/SyncDlg.h +++ b/src/TortoiseProc/SyncDlg.h @@ -38,6 +38,9 @@ #define IDC_OUT_LOGLIST 0x5 #define IDC_OUT_CHANGELIST 0x6 +#define IDT_INPUT 108 + + class CSyncDlg : public CResizableStandAloneDialog,public CBranchCombox { DECLARE_DYNAMIC(CSyncDlg) @@ -178,13 +181,14 @@ public: afx_msg void OnBnClickedButtonPush(); afx_msg void OnBnClickedButtonApply(); afx_msg void OnBnClickedButtonEmail(); + afx_msg void OnTimer(UINT_PTR nIDEvent); CProgressCtrl m_ctrlProgress; CAnimateCtrl m_ctrlAnimate; virtual BOOL OnInitDialog(); afx_msg void OnBnClickedButtonManage(); virtual BOOL PreTranslateMessage(MSG* pMsg); afx_msg void OnCbenEndeditComboboxexUrl(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnCbnEditchangeComboboxexUrl(); + afx_msg void OnCbnEditchangeComboboxex(); void EnableControlButton(bool bEnabled=true); afx_msg void OnBnClickedButtonCommit(); -- 2.11.4.GIT