From: Frank Li Date: Fri, 13 Feb 2009 04:32:53 +0000 (+0800) Subject: Add MFC Tab Control and Rebase Dialog. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=47ac54863a4d4324b12e138f6bf3d75bc455e98e;p=tortoisegit%2FTortoiseGitJp.git Add MFC Tab Control and Rebase Dialog. --- diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index e92b75c..4adba90 100644 Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ diff --git a/src/TortoiseProc/Commands/Command.cpp b/src/TortoiseProc/Commands/Command.cpp index da3db21..f886b4c 100644 --- a/src/TortoiseProc/Commands/Command.cpp +++ b/src/TortoiseProc/Commands/Command.cpp @@ -49,6 +49,7 @@ #include "SettingsCommand.h" #include "ConflictEditorCommand.h" #include "CleanupCommand.h" +#include "RebaseCommand.h" #if 0 @@ -141,6 +142,7 @@ typedef enum cmdRebuildIconCache, cmdRelocate, cmdRemove, + cmdRebase, cmdRename, cmdRepoBrowser, cmdRepoCreate, @@ -206,6 +208,7 @@ static const struct CommandInfo { cmdRebuildIconCache,_T("rebuildiconcache") }, { cmdRelocate, _T("relocate") }, { cmdRemove, _T("remove") }, + { cmdRebase, _T("rebase") }, { cmdRename, _T("rename") }, { cmdRepoBrowser, _T("repobrowser") }, { cmdRepoCreate, _T("repocreate") }, @@ -301,6 +304,8 @@ Command * CommandServer::GetCommand(const CString& sCmd) return new ConflictEditorCommand; case cmdCleanup: return new CleanupCommand; + case cmdRebase: + return new RebaseCommand; #if 0 case cmdCat: diff --git a/src/TortoiseProc/Commands/RebaseCommand.cpp b/src/TortoiseProc/Commands/RebaseCommand.cpp new file mode 100644 index 0000000..d517af1 --- /dev/null +++ b/src/TortoiseProc/Commands/RebaseCommand.cpp @@ -0,0 +1,40 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2007-2008 - TortoiseSVN + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#include "StdAfx.h" +#include "RebaseCommand.h" + +#include "MessageBox.h" +//#include "SVNProgressDlg.h" +//#include "ProgressDlg.h" +#include "RebaseDlg.h" +#include "InputLogDlg.h" +#include "Git.h" +#include "DirFileEnum.h" +#include "ShellUpdater.h" + +bool RebaseCommand::Execute() +{ + bool bRet =false; + CRebaseDlg dlg; + if(dlg.DoModal() == IDOK) + { + bRet=true; + } + return bRet; +} diff --git a/src/TortoiseProc/Commands/RebaseCommand.h b/src/TortoiseProc/Commands/RebaseCommand.h new file mode 100644 index 0000000..8733e78 --- /dev/null +++ b/src/TortoiseProc/Commands/RebaseCommand.h @@ -0,0 +1,35 @@ +// TortoiseSVN - a Windows shell extension for easy version control + +// Copyright (C) 2007 - TortoiseSVN + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#pragma once +#include "Command.h" + +/** + * \ingroup TortoiseProc + * Renames files and folders. + */ +class RebaseCommand : public Command +{ +public: + /** + * Executes the command. + */ + virtual bool Execute(); +}; + + diff --git a/src/TortoiseProc/RebaseDlg.cpp b/src/TortoiseProc/RebaseDlg.cpp index 9e96306..f0b736d 100644 --- a/src/TortoiseProc/RebaseDlg.cpp +++ b/src/TortoiseProc/RebaseDlg.cpp @@ -8,12 +8,10 @@ // CRebaseDlg dialog -IMPLEMENT_DYNAMIC(CRebaseDlg, CDialog) +IMPLEMENT_DYNAMIC(CRebaseDlg, CResizableStandAloneDialog) CRebaseDlg::CRebaseDlg(CWnd* pParent /*=NULL*/) - : CDialog(CRebaseDlg::IDD, pParent) - , m_bPickupAll(false) - , m_bSquashALL(false) + : CResizableStandAloneDialog(CRebaseDlg::IDD, pParent) , m_bPickAll(FALSE) , m_bSquashAll(FALSE) , m_bEditAll(FALSE) @@ -36,14 +34,50 @@ void CRebaseDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CRebaseDlg, CDialog) +BEGIN_MESSAGE_MAP(CRebaseDlg, CResizableStandAloneDialog) ON_BN_CLICKED(IDC_PICK_ALL, &CRebaseDlg::OnBnClickedPickAll) ON_BN_CLICKED(IDC_SQUASH_ALL, &CRebaseDlg::OnBnClickedSquashAll) ON_BN_CLICKED(IDC_EDIT_ALL, &CRebaseDlg::OnBnClickedEditAll) ON_BN_CLICKED(IDC_REBASE_SPLIT, &CRebaseDlg::OnBnClickedRebaseSplit) END_MESSAGE_MAP() - +BOOL CRebaseDlg::OnInitDialog() +{ + CResizableStandAloneDialog::OnInitDialog(); + + CRect rectDummy; + //IDC_REBASE_DUMY_TAB + + CWnd *pwnd=this->GetDlgItem(IDC_REBASE_DUMY_TAB); + pwnd->GetWindowRect(&rectDummy); + + if (!m_ctrlTabCtrl.Create(CMFCTabCtrl::STYLE_FLAT, rectDummy, this, 0)) + { + TRACE0("Failed to create output tab window\n"); + return FALSE; // fail to create + } + m_ctrlTabCtrl.SetResizeMode(CMFCTabCtrl::RESIZE_NO); + // Create output panes: + //const DWORD dwStyle = LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL; + const DWORD dwStyle =LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | WS_BORDER | WS_TABSTOP |LVS_SINGLESEL |WS_CHILD | WS_VISIBLE; + + if (! this->m_FileListCtrl.Create(dwStyle,rectDummy,&this->m_ctrlTabCtrl,0) ) + { + TRACE0("Failed to create output windows\n"); + return FALSE; // fail to create + } + + if( ! this->m_LogMessageCtrl.Create(_T("Scintilla"),_T("source"),0,rectDummy,&m_ctrlTabCtrl,0,0) ) + { + TRACE0("Failed to create log message control"); + return FALSE; + } + + m_ctrlTabCtrl.AddTab(&m_FileListCtrl,_T("Modified File")); + m_ctrlTabCtrl.AddTab(&m_LogMessageCtrl,_T("Log Message"),1); + + return TRUE; +} // CRebaseDlg message handlers void CRebaseDlg::OnBnClickedPickAll() diff --git a/src/TortoiseProc/RebaseDlg.h b/src/TortoiseProc/RebaseDlg.h index bff6e04..b53b07e 100644 --- a/src/TortoiseProc/RebaseDlg.h +++ b/src/TortoiseProc/RebaseDlg.h @@ -1,11 +1,12 @@ #pragma once #include "afxcmn.h" #include "afxwin.h" - - +#include "StandAloneDlg.h" +#include "GitStatusListCtrl.h" +#include "SciEdit.h" // CRebaseDlg dialog -class CRebaseDlg : public CDialog +class CRebaseDlg : public CResizableStandAloneDialog { DECLARE_DYNAMIC(CRebaseDlg) @@ -18,12 +19,10 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - + virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: - bool m_bPickupAll; - bool m_bSquashALL; - + afx_msg void OnBnClickedPickAll(); afx_msg void OnBnClickedSquashAll(); afx_msg void OnBnClickedEditAll(); @@ -33,4 +32,8 @@ public: BOOL m_bPickAll; BOOL m_bSquashAll; BOOL m_bEditAll; + + CMFCTabCtrl m_ctrlTabCtrl; + CGitStatusListCtrl m_FileListCtrl; + CSciEdit m_LogMessageCtrl; }; diff --git a/src/TortoiseProc/TortoiseProc.vcproj b/src/TortoiseProc/TortoiseProc.vcproj index 1199c8e..145ed3e 100644 --- a/src/TortoiseProc/TortoiseProc.vcproj +++ b/src/TortoiseProc/TortoiseProc.vcproj @@ -417,14 +417,6 @@ > - - - - @@ -1386,26 +1378,6 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + +