From 15d631331de487109cb3b4221c81333d36c7cbb4 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Fri, 20 Feb 2009 14:27:41 +0800 Subject: [PATCH] Add Show Whole Project Checkbox at commitdlg. Signed-off-by: Frank Li --- src/Git/GitStatusListCtrl.cpp | 2 +- src/TortoiseProc/Commands/CommitCommand.cpp | 6 ++ src/TortoiseProc/CommitDlg.cpp | 45 +++++++++++- src/TortoiseProc/CommitDlg.h | 1 + src/TortoiseProc/RebaseDlg.cpp | 2 +- src/TortoiseProc/TortoiseProc.vcproj | 102 ++++++++++++++-------------- 6 files changed, 102 insertions(+), 56 deletions(-) diff --git a/src/Git/GitStatusListCtrl.cpp b/src/Git/GitStatusListCtrl.cpp index df54196..719f775 100644 --- a/src/Git/GitStatusListCtrl.cpp +++ b/src/Git/GitStatusListCtrl.cpp @@ -299,7 +299,7 @@ BOOL CGitStatusListCtrl::GetStatus ( const CTGitPathList* pathList mask|= CGitStatusListCtrl::FILELIST_IGNORE; if(bShowUnRev) mask|= CGitStatusListCtrl::FILELIST_UNVER; - this->UpdateFileList(mask,bUpdate,pathList); + this->UpdateFileList(mask,bUpdate,(CTGitPathList*)pathList); #if 0 diff --git a/src/TortoiseProc/Commands/CommitCommand.cpp b/src/TortoiseProc/Commands/CommitCommand.cpp index a30bc42..fa5bda5 100644 --- a/src/TortoiseProc/Commands/CommitCommand.cpp +++ b/src/TortoiseProc/Commands/CommitCommand.cpp @@ -75,6 +75,12 @@ bool CommitCommand::Execute() { dlg.m_sBugID = parser.GetVal(_T("bugid")); } + + if (parser.HasKey(_T("wholeproject"))) + { + dlg.m_bWholeProject = TRUE; + } + dlg.m_sLogMessage = sLogMsg; dlg.m_pathList = pathList; dlg.m_checkedPathList = selectedList; diff --git a/src/TortoiseProc/CommitDlg.cpp b/src/TortoiseProc/CommitDlg.cpp index 8b06ab6..7bf2c24 100644 --- a/src/TortoiseProc/CommitDlg.cpp +++ b/src/TortoiseProc/CommitDlg.cpp @@ -98,6 +98,7 @@ BEGIN_MESSAGE_MAP(CCommitDlg, CResizableStandAloneDialog) ON_BN_CLICKED(IDC_SIGNOFF, &CCommitDlg::OnBnClickedSignOff) ON_STN_CLICKED(IDC_COMMITLABEL, &CCommitDlg::OnStnClickedCommitlabel) ON_BN_CLICKED(IDC_COMMIT_AMEND, &CCommitDlg::OnBnClickedCommitAmend) + ON_BN_CLICKED(IDC_WHOLE_PROJECT, &CCommitDlg::OnBnClickedWholeProject) END_MESSAGE_MAP() BOOL CCommitDlg::OnInitDialog() @@ -656,6 +657,7 @@ UINT CCommitDlg::StatusThread() DialogEnableWindow(IDOK, false); DialogEnableWindow(IDC_SHOWUNVERSIONED, false); + DialogEnableWindow(IDC_WHOLE_PROJECT, false); DialogEnableWindow(IDC_SELECTALL, false); GetDlgItem(IDC_EXTERNALWARNING)->ShowWindow(SW_HIDE); DialogEnableWindow(IDC_EXTERNALWARNING, false); @@ -677,7 +679,11 @@ UINT CCommitDlg::StatusThread() #endif // Initialise the list control with the status of the files/folders below us m_ListCtrl.Clear(); - BOOL success = m_ListCtrl.GetStatus(&m_pathList); + BOOL success; + if(m_bWholeProject) + success=m_ListCtrl.GetStatus(NULL); + else + success=m_ListCtrl.GetStatus(&m_pathList); //m_ListCtrl.UpdateFileList(git_revnum_t(GIT_REV_ZERO)); if(this->m_bShowUnversioned) @@ -730,7 +736,11 @@ UINT CCommitDlg::StatusThread() } CTGitPath commonDir = m_ListCtrl.GetCommonDirectory(false); - SetWindowText(m_sWindowTitle + _T(" - ") + commonDir.GetWinPathString()); + + if(this->m_bWholeProject) + SetWindowText(m_sWindowTitle + _T(" - ") + CString(_T("Whole Project"))); + else + SetWindowText(m_sWindowTitle + _T(" - ") + commonDir.GetWinPathString()); m_autolist.clear(); // we don't have to block the commit dialog while we fetch the @@ -746,6 +756,7 @@ UINT CCommitDlg::StatusThread() if (m_bRunThread) { DialogEnableWindow(IDC_SHOWUNVERSIONED, true); + DialogEnableWindow(IDC_WHOLE_PROJECT, true); DialogEnableWindow(IDC_SELECTALL, true); if (m_ListCtrl.HasChangeLists()) DialogEnableWindow(IDC_KEEPLISTS, true); @@ -894,7 +905,10 @@ void CCommitDlg::OnBnClickedShowunversioned() dwShow &= ~SVNSLC_SHOWUNVERSIONED; if(dwShow & SVNSLC_SHOWUNVERSIONED) { - m_ListCtrl.GetStatus(&this->m_pathList,false,false,true); + if(m_bWholeProject) + m_ListCtrl.GetStatus(NULL,false,false,true); + else + m_ListCtrl.GetStatus(&this->m_pathList,false,false,true); } m_ListCtrl.Show(dwShow); } @@ -1510,3 +1524,28 @@ void CCommitDlg::OnBnClickedCommitAmend() } } + +void CCommitDlg::OnBnClickedWholeProject() +{ + // TODO: Add your control notification handler code here + m_tooltips.Pop(); // hide the tooltips + UpdateData(); + m_ListCtrl.Clear(); + if (!m_bBlock) + { + if(m_bWholeProject) + m_ListCtrl.GetStatus(NULL,true,false,true); + else + m_ListCtrl.GetStatus(&this->m_pathList,true,false,true); + + m_ListCtrl.Show(m_ListCtrl.GetShowFlags()); + } + + CTGitPath commonDir = m_ListCtrl.GetCommonDirectory(false); + + if(this->m_bWholeProject) + SetWindowText(m_sWindowTitle + _T(" - ") + CString(_T("Whole Project"))); + else + SetWindowText(m_sWindowTitle + _T(" - ") + commonDir.GetWinPathString()); + +} diff --git a/src/TortoiseProc/CommitDlg.h b/src/TortoiseProc/CommitDlg.h index 8a235b1..0d188fc 100644 --- a/src/TortoiseProc/CommitDlg.h +++ b/src/TortoiseProc/CommitDlg.h @@ -143,4 +143,5 @@ public: afx_msg void OnBnClickedSignOff(); afx_msg void OnStnClickedCommitlabel(); afx_msg void OnBnClickedCommitAmend(); + afx_msg void OnBnClickedWholeProject(); }; diff --git a/src/TortoiseProc/RebaseDlg.cpp b/src/TortoiseProc/RebaseDlg.cpp index cab8be1..e1f0cdf 100644 --- a/src/TortoiseProc/RebaseDlg.cpp +++ b/src/TortoiseProc/RebaseDlg.cpp @@ -1037,7 +1037,7 @@ void CRebaseDlg::ListConflictFile() CTGitPath path; list.AddPath(path); - this->m_FileListCtrl.GetStatus(list,true); + this->m_FileListCtrl.GetStatus(&list,true); this->m_FileListCtrl.Show(CTGitPath::LOGACTIONS_UNMERGED|CTGitPath::LOGACTIONS_MODIFIED,CTGitPath::LOGACTIONS_UNMERGED); if( this->m_FileListCtrl.GetItemCount() == 0 ) { diff --git a/src/TortoiseProc/TortoiseProc.vcproj b/src/TortoiseProc/TortoiseProc.vcproj index dae2a4d..264fdd8 100644 --- a/src/TortoiseProc/TortoiseProc.vcproj +++ b/src/TortoiseProc/TortoiseProc.vcproj @@ -1,7 +1,7 @@ @@ -169,19 +165,14 @@ @@ -262,14 +257,19 @@ -- 2.11.0