OSDN Git Service

Add MFC Tab Control and Rebase Dialog.
authorFrank Li <lznuaa@gmail.com>
Fri, 13 Feb 2009 04:32:53 +0000 (12:32 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 13 Feb 2009 04:32:53 +0000 (12:32 +0800)
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Commands/Command.cpp
src/TortoiseProc/Commands/RebaseCommand.cpp [new file with mode: 0644]
src/TortoiseProc/Commands/RebaseCommand.h [new file with mode: 0644]
src/TortoiseProc/RebaseDlg.cpp
src/TortoiseProc/RebaseDlg.h
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseProc/resource.h

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