OSDN Git Service

Add SYNC dialog
authorFrank Li <lznuaa@gmail.com>
Sun, 19 Jul 2009 06:03:25 +0000 (14:03 +0800)
committerFrank Li <lznuaa@gmail.com>
Sun, 19 Jul 2009 06:04:41 +0000 (14:04 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Commands/Command.cpp
src/TortoiseProc/Commands/SyncCommand.cpp [new file with mode: 0644]
src/TortoiseProc/Commands/SyncCommand.h [new file with mode: 0644]
src/TortoiseProc/SyncDlg.cpp [new file with mode: 0644]
src/TortoiseProc/SyncDlg.h [new file with mode: 0644]
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseProc/resource.h

index 6aea821..2ad7304 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 22bf3a2..28f9abc 100644 (file)
@@ -64,6 +64,7 @@
 #include "RefBrowseCommand.h"\r
 #include "SVNDCommitCommand.h"\r
 #include "SVNRebaseCommand.h"\r
+#include "SyncCommand.h"\r
 \r
 #if 0\r
 \r
@@ -182,6 +183,7 @@ typedef enum
        cmdRefBrowse,\r
        cmdSVNDCommit,\r
        cmdSVNRebase,\r
+       cmdSync,\r
        \r
 } TGitCommand;\r
 \r
@@ -259,6 +261,7 @@ static const struct CommandInfo
        {       cmdRefBrowse,           _T("refbrowse")                 },\r
        {       cmdSVNDCommit,          _T("svndcommit")                },\r
        {       cmdSVNRebase,           _T("svnrebase")                 },\r
+       {       cmdSync,                        _T("sync")                              },\r
 };\r
 \r
 \r
@@ -374,6 +377,8 @@ Command * CommandServer::GetCommand(const CString& sCmd)
                return new SVNDCommitCommand;\r
        case cmdSVNRebase:\r
                return new SVNRebaseCommand;\r
+       case cmdSync:\r
+               return new SyncCommand;\r
 #if 0\r
 \r
        \r
diff --git a/src/TortoiseProc/Commands/SyncCommand.cpp b/src/TortoiseProc/Commands/SyncCommand.cpp
new file mode 100644 (file)
index 0000000..7228977
--- /dev/null
@@ -0,0 +1,38 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2008-2009 - TortoiseGit\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 "TortoiseProc.h"\r
+#include "messagebox.h"\r
+#include "DirFileEnum.h"\r
+#include "SyncDlg.h"\r
+//#include "SVNConfig.h"\r
+#include "Registry.h"\r
+#include "CommonResource.h"\r
+#include "SyncCommand.h"\r
+\r
+bool SyncCommand::Execute()\r
+{\r
+       bool bRet = false;\r
+       CSyncDlg dlg;\r
+       if(dlg.DoModal() == IDOK)\r
+               bRet=true;\r
+\r
+       return bRet;\r
+}\r
+\r
diff --git a/src/TortoiseProc/Commands/SyncCommand.h b/src/TortoiseProc/Commands/SyncCommand.h
new file mode 100644 (file)
index 0000000..52147d4
--- /dev/null
@@ -0,0 +1,36 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2008-2009 - TortoiseGit\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
+\r
+#pragma once\r
+#include "Command.h"\r
+\r
+/**\r
+ * \ingroup TortoiseProc\r
+ * Shows the add dialog.\r
+ */\r
+class SyncCommand : public Command\r
+{\r
+public:\r
+       /**\r
+        * Executes the command.\r
+        */\r
+       virtual bool                    Execute();\r
+};\r
+\r
+\r
diff --git a/src/TortoiseProc/SyncDlg.cpp b/src/TortoiseProc/SyncDlg.cpp
new file mode 100644 (file)
index 0000000..97ee96f
--- /dev/null
@@ -0,0 +1,87 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2008-2009 - TortoiseGit\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
+\r
+// SyncDlg.cpp : implementation file\r
+//\r
+\r
+#include "stdafx.h"\r
+#include "TortoiseProc.h"\r
+#include "SyncDlg.h"\r
+\r
+\r
+// CSyncDlg dialog\r
+\r
+IMPLEMENT_DYNAMIC(CSyncDlg, CDialog)\r
+\r
+CSyncDlg::CSyncDlg(CWnd* pParent /*=NULL*/)\r
+       : CDialog(CSyncDlg::IDD, pParent)\r
+       , m_bAutoLoadPuttyKey(FALSE)\r
+{\r
+\r
+}\r
+\r
+CSyncDlg::~CSyncDlg()\r
+{\r
+}\r
+\r
+void CSyncDlg::DoDataExchange(CDataExchange* pDX)\r
+{\r
+       CDialog::DoDataExchange(pDX);\r
+       DDX_Check(pDX, IDC_CHECK_PUTTY_KEY, m_bAutoLoadPuttyKey);\r
+       DDX_Control(pDX, IDC_COMBOBOXEX_LOCAL_BRANCH, m_ctrlLocalBranch);\r
+       DDX_Control(pDX, IDC_COMBOBOXEX_REMOTE_BRANCH, m_ctrlRemoteBranch);\r
+       DDX_Control(pDX, IDC_COMBOBOXEX_URL, m_ctrlURL);\r
+       DDX_Control(pDX, IDC_BUTTON_TABCTRL, m_ctrlDumyButton);\r
+       DDX_Control(pDX, IDC_BUTTON_PULL, m_ctrlPull);\r
+       DDX_Control(pDX, IDC_BUTTON_PUSH, m_ctrlPush);\r
+       DDX_Control(pDX, IDC_STATIC_STATUS, m_ctrlStatus);\r
+       DDX_Control(pDX, IDC_PROGRESS_SYNC, m_ctrlProgress);\r
+       DDX_Control(pDX, IDC_ANIMATE_SYNC, m_ctrlAnimate);\r
+}\r
+\r
+\r
+BEGIN_MESSAGE_MAP(CSyncDlg, CDialog)\r
+       ON_BN_CLICKED(IDC_BUTTON_PULL, &CSyncDlg::OnBnClickedButtonPull)\r
+       ON_BN_CLICKED(IDC_BUTTON_PUSH, &CSyncDlg::OnBnClickedButtonPush)\r
+       ON_BN_CLICKED(IDC_BUTTON_APPLY, &CSyncDlg::OnBnClickedButtonApply)\r
+       ON_BN_CLICKED(IDC_BUTTON_EMAIL, &CSyncDlg::OnBnClickedButtonEmail)\r
+END_MESSAGE_MAP()\r
+\r
+\r
+// CSyncDlg message handlers\r
+\r
+void CSyncDlg::OnBnClickedButtonPull()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+}\r
+\r
+void CSyncDlg::OnBnClickedButtonPush()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+}\r
+\r
+void CSyncDlg::OnBnClickedButtonApply()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+}\r
+\r
+void CSyncDlg::OnBnClickedButtonEmail()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+}\r
diff --git a/src/TortoiseProc/SyncDlg.h b/src/TortoiseProc/SyncDlg.h
new file mode 100644 (file)
index 0000000..4e6dfd7
--- /dev/null
@@ -0,0 +1,57 @@
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2008-2009 - TortoiseGit\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
+\r
+#pragma once\r
+#include "afxcmn.h"\r
+#include "afxwin.h"\r
+\r
+\r
+// CSyncDlg dialog\r
+\r
+class CSyncDlg : public CDialog\r
+{\r
+       DECLARE_DYNAMIC(CSyncDlg)\r
+\r
+public:\r
+       CSyncDlg(CWnd* pParent = NULL);   // standard constructor\r
+       virtual ~CSyncDlg();\r
+\r
+// Dialog Data\r
+       enum { IDD = IDD_SYNC };\r
+\r
+protected:\r
+       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
+\r
+       DECLARE_MESSAGE_MAP()\r
+public:\r
+       BOOL m_bAutoLoadPuttyKey;\r
+       CComboBoxEx m_ctrlLocalBranch;\r
+       CComboBoxEx m_ctrlRemoteBranch;\r
+       CComboBoxEx m_ctrlURL;\r
+       CButton m_ctrlDumyButton;\r
+       CButton m_ctrlPull;\r
+       CButton m_ctrlPush;\r
+       CStatic m_ctrlStatus;\r
+       afx_msg void OnBnClickedButtonPull();\r
+       afx_msg void OnBnClickedButtonPush();\r
+       afx_msg void OnBnClickedButtonApply();\r
+       afx_msg void OnBnClickedButtonEmail();\r
+       CProgressCtrl m_ctrlProgress;\r
+       CAnimateCtrl m_ctrlAnimate;\r
+};\r
index 5dc37c5..e980a58 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\copy.ico"\r
+                               RelativePath="..\Resources\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\copy.ico"\r
+                               RelativePath=".\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\explorer.ico"\r
+                               RelativePath=".\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\explorer.ico"\r
+                               RelativePath="..\Resources\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\newfolder.ico"\r
+                               RelativePath="..\Resources\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\newfolder.ico"\r
+                               RelativePath=".\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\refresh.ico"\r
+                               RelativePath="..\Resources\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\refresh.ico"\r
+                               RelativePath=".\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\save.ico"\r
+                               RelativePath=".\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\save.ico"\r
+                               RelativePath="..\Resources\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\up.ico"\r
+                               RelativePath="..\Resources\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\up.ico"\r
+                               RelativePath=".\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                        >\r
                                </File>\r
                        </Filter>\r
+                       <Filter\r
+                               Name="Sync"\r
+                               >\r
+                               <File\r
+                                       RelativePath=".\Commands\SyncCommand.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\Commands\SyncCommand.h"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\SyncDlg.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\SyncDlg.h"\r
+                                       >\r
+                               </File>\r
+                       </Filter>\r
                </Filter>\r
                <Filter\r
                        Name="Utility Dialogs"\r
index cd17e9d..3660354 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ