OSDN Git Service

Add SendMail Dialog
authorFrank Li <lznuaa@gmail.com>
Mon, 13 Apr 2009 07:30:20 +0000 (15:30 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 13 Apr 2009 07:30:20 +0000 (15:30 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Commands/Command.cpp
src/TortoiseProc/Commands/SendMailCommand.cpp [new file with mode: 0644]
src/TortoiseProc/Commands/SendMailCommand.h [new file with mode: 0644]
src/TortoiseProc/SendMailDlg.cpp [new file with mode: 0644]
src/TortoiseProc/SendMailDlg.h [new file with mode: 0644]
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseProc/resource.h

index 5f3e2e2..928c47e 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index ca02b31..887147c 100644 (file)
@@ -59,6 +59,7 @@
 #include "StashCommand.h"\r
 #include "SubmoduleCommand.h"\r
 #include "ReflogCommand.h"\r
+#include "SendMailCommand.h"\r
 \r
 #if 0\r
 \r
@@ -157,6 +158,7 @@ typedef enum
        cmdResolve,\r
        cmdRevert,\r
        cmdRevisionGraph,\r
+       cmdSendMail,\r
        cmdSettings,\r
        cmdShowCompare,\r
        cmdSwitch,\r
@@ -230,6 +232,7 @@ static const struct CommandInfo
        {       cmdResolve,                     _T("resolve")                   },\r
        {       cmdRevert,                      _T("revert")                    },\r
        {       cmdRevisionGraph,       _T("revisiongraph")             },\r
+       {       cmdSendMail,            _T("sendmail")                  },\r
        {       cmdSettings,            _T("settings")                  },\r
        {       cmdShowCompare,         _T("showcompare")               },\r
        {       cmdSwitch,                      _T("switch")                    },\r
@@ -351,6 +354,8 @@ Command * CommandServer::GetCommand(const CString& sCmd)
                return new RefLogCommand;\r
        case cmdSubSync:\r
                return new SubmoduleSyncCommand;\r
+       case cmdSendMail:\r
+               return new SendMailCommand;\r
 \r
 #if 0\r
 \r
diff --git a/src/TortoiseProc/Commands/SendMailCommand.cpp b/src/TortoiseProc/Commands/SendMailCommand.cpp
new file mode 100644 (file)
index 0000000..1dd7a62
--- /dev/null
@@ -0,0 +1,13 @@
+#include "StdAfx.h"\r
+#include "SendMailCommand.h"\r
+#include "SendMailDlg.h"\r
+\r
+bool SendMailCommand::Execute()\r
+{\r
+       CSendMailDlg dlg;\r
+       if(dlg.DoModal()==IDOK)\r
+       {\r
+               return true;\r
+       }\r
+       return false;\r
+}
\ No newline at end of file
diff --git a/src/TortoiseProc/Commands/SendMailCommand.h b/src/TortoiseProc/Commands/SendMailCommand.h
new file mode 100644 (file)
index 0000000..d14d2e1
--- /dev/null
@@ -0,0 +1,15 @@
+#pragma once\r
+#include "Command.h"\r
+\r
+/**\r
+ * \ingroup TortoiseProc\r
+ * Renames files and folders.\r
+ */\r
+class SendMailCommand : public Command\r
+{\r
+public:\r
+       /**\r
+        * Executes the command.\r
+        */\r
+       virtual bool                    Execute();\r
+};\r
diff --git a/src/TortoiseProc/SendMailDlg.cpp b/src/TortoiseProc/SendMailDlg.cpp
new file mode 100644 (file)
index 0000000..fdcd57d
--- /dev/null
@@ -0,0 +1,69 @@
+// SendMailDlg.cpp : implementation file\r
+//\r
+\r
+#include "stdafx.h"\r
+#include "TortoiseProc.h"\r
+#include "SendMailDlg.h"\r
+\r
+\r
+// CSendMailDlg dialog\r
+\r
+IMPLEMENT_DYNAMIC(CSendMailDlg, CResizableStandAloneDialog)\r
+\r
+CSendMailDlg::CSendMailDlg(CWnd* pParent /*=NULL*/)\r
+       : CResizableStandAloneDialog(CSendMailDlg::IDD, pParent)\r
+       , m_To(_T(""))\r
+       , m_CC(_T(""))\r
+       , m_Subject(_T(""))\r
+       , m_bAttachment(FALSE)\r
+       , m_bBranch(FALSE)\r
+{\r
+\r
+}\r
+\r
+CSendMailDlg::~CSendMailDlg()\r
+{\r
+}\r
+\r
+void CSendMailDlg::DoDataExchange(CDataExchange* pDX)\r
+{\r
+       CDialog::DoDataExchange(pDX);\r
+       DDX_Text(pDX, IDC_SENDMAIL_TO, m_To);\r
+       DDX_Text(pDX, IDC_SENDMAIL_CC, m_CC);\r
+       DDX_Text(pDX, IDC_SENDMAIL_SUBJECT, m_Subject);\r
+       DDX_Check(pDX, IDC_SENDMAIL_ATTACHMENT, m_bAttachment);\r
+       DDX_Check(pDX, IDC_SENDMAIL_COMBINE, m_bBranch);\r
+       DDX_Control(pDX, IDC_SENDMAIL_PATCHS, m_ctrlList);\r
+       DDX_Control(pDX,IDC_SENDMAIL_SETUP, this->m_SmtpSetup);\r
+}\r
+\r
+\r
+BEGIN_MESSAGE_MAP(CSendMailDlg, CResizableStandAloneDialog)\r
+       ON_BN_CLICKED(IDC_SENDMAIL_COMBINE, &CSendMailDlg::OnBnClickedSendmailCombine)\r
+END_MESSAGE_MAP()\r
+\r
+\r
+// CSendMailDlg message handlers\r
+\r
+BOOL CSendMailDlg::OnInitDialog()\r
+{\r
+       CResizableStandAloneDialog::OnInitDialog();\r
+\r
+       AddAnchor(IDC_SENDMAIL_GROUP,TOP_LEFT,TOP_RIGHT);\r
+       AddAnchor(IDC_SENDMAIL_TO,TOP_LEFT,TOP_RIGHT);\r
+       AddAnchor(IDC_SENDMAIL_CC,TOP_LEFT,TOP_RIGHT);\r
+       AddAnchor(IDC_SENDMAIL_SUBJECT,TOP_LEFT,TOP_RIGHT);\r
+       AddAnchor(IDC_SENDMAIL_SETUP,TOP_RIGHT);\r
+\r
+       AddAnchor(IDC_SENDMAIL_PATCHS,TOP_LEFT,BOTTOM_RIGHT);\r
+       AddAnchor(IDOK,BOTTOM_RIGHT);\r
+       AddAnchor(IDCANCEL,BOTTOM_RIGHT);\r
+\r
+       this->AddOthersToAnchor();\r
+       EnableSaveRestore(_T("SendMailDlg"));\r
+       return TRUE;\r
+}\r
+void CSendMailDlg::OnBnClickedSendmailCombine()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+}\r
diff --git a/src/TortoiseProc/SendMailDlg.h b/src/TortoiseProc/SendMailDlg.h
new file mode 100644 (file)
index 0000000..8b119d3
--- /dev/null
@@ -0,0 +1,33 @@
+#pragma once\r
+#include "afxcmn.h"\r
+#include "StandAloneDlg.h"\r
+#include "HyperLink.h"\r
+// CSendMailDlg dialog\r
+\r
+class CSendMailDlg : public CResizableStandAloneDialog\r
+{\r
+       DECLARE_DYNAMIC(CSendMailDlg)\r
+\r
+public:\r
+       CSendMailDlg(CWnd* pParent = NULL);   // standard constructor\r
+       virtual ~CSendMailDlg();\r
+\r
+// Dialog Data\r
+       enum { IDD = IDD_SENDMAIL };\r
+\r
+protected:\r
+       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
+       virtual BOOL OnInitDialog();\r
+       DECLARE_MESSAGE_MAP()\r
+\r
+       CHyperLink  m_SmtpSetup;\r
+\r
+public:\r
+       CString m_To;\r
+       CString m_CC;\r
+       CString m_Subject;\r
+       BOOL m_bAttachment;\r
+       BOOL m_bBranch;\r
+       CListCtrl m_ctrlList;\r
+       afx_msg void OnBnClickedSendmailCombine();\r
+};\r
index 4209ea9..eeba0ce 100644 (file)
                        />\r
                </Configuration>\r
                <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="..\..\bin\$(ConfigurationName)\bin"\r
-                       IntermediateDirectory="..\..\obj\TortoiseProc\$(ConfigurationName)"\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="..\..\bin\Debug64\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseProc\Debug64"\r
                        ConfigurationType="1"\r
                        UseOfMFC="2"\r
+                       UseOfATL="0"\r
                        CharacterSet="1"\r
-                       WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                        <Tool\r
                                Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="NDEBUG"\r
+                               PreprocessorDefinitions="_DEBUG"\r
                                MkTypLibCompatible="false"\r
+                               TargetEnvironment="3"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
                                AdditionalIncludeDirectories="..\TortoiseProc;..\Resources;&quot;$InputDir&quot;;../../ext/ResizableLib;../Git;&quot;../../ext/apr-util/include&quot;;&quot;../../ext/apr-util/xml/expat/lib&quot;;../../ext/Subversion/subversion/include;../../ext/Subversion/subversion/libsvn_client;../../ext/apr/include;../../ext/boost;..\Utils;..\SVN;..\..\ext\ResizableLib;..\crashrpt;&quot;..\..\ext\libintl\libintl3-win32\inc&quot;;..\..\ext\hunspell;..\..\ext\scintilla\include;..\Utils\TreePropSheet;..\Utils\ColourPickerXP;..\Utils\NewMenu;..\Utils\MiscUI;..\LogCache;&quot;../../ext/cyrus-sasl/include&quot;;../../../common/openssl/inc32;.\RevisionGraph;..\TortoiseShell"\r
-                               PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;THESAURUS"\r
-                               StringPooling="true"\r
-                               MinimalRebuild="false"\r
+                               PreprocessorDefinitions="WIN64;_WINDOWS;_DEBUG;SVN_DEBUG;ENABLE_NLS;THESAURUS"\r
+                               MinimalRebuild="true"\r
                                ExceptionHandling="2"\r
-                               RuntimeLibrary="2"\r
-                               BufferSecurityCheck="false"\r
+                               RuntimeLibrary="3"\r
                                TreatWChar_tAsBuiltInType="true"\r
                                ForceConformanceInForLoopScope="true"\r
                                RuntimeTypeInfo="true"\r
                                UsePrecompiledHeader="2"\r
                                WarningLevel="4"\r
                                DebugInformationFormat="3"\r
-                               DisableSpecificWarnings="4996,4018"\r
                        />\r
                        <Tool\r
                                Name="VCManagedResourceCompilerTool"\r
                        />\r
                        <Tool\r
                                Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="NDEBUG"\r
+                               PreprocessorDefinitions="_DEBUG"\r
                                Culture="1033"\r
                                AdditionalIncludeDirectories="&quot;$(IntDir)&quot;;..\TortoiseShell"\r
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="Crypt32.lib gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="../../ext/wingit"\r
+                               LinkIncremental="2"\r
                                IgnoreDefaultLibraryNames=""\r
                                DelayLoadDLLs="gdiplus.dll"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               OptimizeForWindows98="0"\r
                                RandomizedBaseAddress="1"\r
                                DataExecutionPrevention="0"\r
-                               TargetMachine="1"\r
-                               Profile="true"\r
+                               TargetMachine="17"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                </Configuration>\r
                <Configuration\r
-                       Name="Debug|x64"\r
-                       OutputDirectory="..\..\bin\Debug64\bin"\r
-                       IntermediateDirectory="..\..\obj\TortoiseProc\Debug64"\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="..\..\bin\$(ConfigurationName)\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseProc\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
                        UseOfMFC="2"\r
-                       UseOfATL="0"\r
                        CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                        <Tool\r
                                Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="_DEBUG"\r
+                               PreprocessorDefinitions="NDEBUG"\r
                                MkTypLibCompatible="false"\r
-                               TargetEnvironment="3"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
                                AdditionalIncludeDirectories="..\TortoiseProc;..\Resources;&quot;$InputDir&quot;;../../ext/ResizableLib;../Git;&quot;../../ext/apr-util/include&quot;;&quot;../../ext/apr-util/xml/expat/lib&quot;;../../ext/Subversion/subversion/include;../../ext/Subversion/subversion/libsvn_client;../../ext/apr/include;../../ext/boost;..\Utils;..\SVN;..\..\ext\ResizableLib;..\crashrpt;&quot;..\..\ext\libintl\libintl3-win32\inc&quot;;..\..\ext\hunspell;..\..\ext\scintilla\include;..\Utils\TreePropSheet;..\Utils\ColourPickerXP;..\Utils\NewMenu;..\Utils\MiscUI;..\LogCache;&quot;../../ext/cyrus-sasl/include&quot;;../../../common/openssl/inc32;.\RevisionGraph;..\TortoiseShell"\r
-                               PreprocessorDefinitions="WIN64;_WINDOWS;_DEBUG;SVN_DEBUG;ENABLE_NLS;THESAURUS"\r
-                               MinimalRebuild="true"\r
+                               PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;THESAURUS"\r
+                               StringPooling="true"\r
+                               MinimalRebuild="false"\r
                                ExceptionHandling="2"\r
-                               RuntimeLibrary="3"\r
+                               RuntimeLibrary="2"\r
+                               BufferSecurityCheck="false"\r
                                TreatWChar_tAsBuiltInType="true"\r
                                ForceConformanceInForLoopScope="true"\r
                                RuntimeTypeInfo="true"\r
                                UsePrecompiledHeader="2"\r
                                WarningLevel="4"\r
                                DebugInformationFormat="3"\r
+                               DisableSpecificWarnings="4996,4018"\r
                        />\r
                        <Tool\r
                                Name="VCManagedResourceCompilerTool"\r
                        />\r
                        <Tool\r
                                Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="_DEBUG"\r
+                               PreprocessorDefinitions="NDEBUG"\r
                                Culture="1033"\r
                                AdditionalIncludeDirectories="&quot;$(IntDir)&quot;;..\TortoiseShell"\r
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="Crypt32.lib gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib"\r
-                               LinkIncremental="2"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="../../ext/wingit"\r
                                IgnoreDefaultLibraryNames=""\r
                                DelayLoadDLLs="gdiplus.dll"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               OptimizeForWindows98="0"\r
                                RandomizedBaseAddress="1"\r
                                DataExecutionPrevention="0"\r
-                               TargetMachine="17"\r
+                               TargetMachine="1"\r
+                               Profile="true"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\copy.ico"\r
+                               RelativePath=".\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\copy.ico"\r
+                               RelativePath="..\Resources\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\explorer.ico"\r
+                               RelativePath="..\Resources\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\explorer.ico"\r
+                               RelativePath=".\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\newfolder.ico"\r
+                               RelativePath=".\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\newfolder.ico"\r
+                               RelativePath="..\Resources\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\refresh.ico"\r
+                               RelativePath=".\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\refresh.ico"\r
+                               RelativePath="..\Resources\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\save.ico"\r
+                               RelativePath="..\Resources\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\save.ico"\r
+                               RelativePath=".\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\up.ico"\r
+                               RelativePath=".\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\up.ico"\r
+                               RelativePath="..\Resources\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                        >\r
                                </File>\r
                        </Filter>\r
+                       <Filter\r
+                               Name="SendMail"\r
+                               >\r
+                               <File\r
+                                       RelativePath=".\Commands\SendMailCommand.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\Commands\SendMailCommand.h"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\SendMailDlg.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\SendMailDlg.h"\r
+                                       >\r
+                               </File>\r
+                       </Filter>\r
                </Filter>\r
                <Filter\r
                        Name="Utility Dialogs"\r
                                />\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
-                               Name="Release|Win32"\r
+                               Name="Debug|x64"\r
                                >\r
                                <Tool\r
                                        Name="VCCLCompilerTool"\r
                                />\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
-                               Name="Debug|x64"\r
+                               Name="Release|Win32"\r
                                >\r
                                <Tool\r
                                        Name="VCCLCompilerTool"\r
                />\r
                <Global\r
                        Name="RESOURCE_FILE"\r
-                       Value="\build\x64\TortoiseGit\src\Resources\TortoiseProcENG.rc"\r
+                       Value="\TortoiseGit\src\Resources\TortoiseProcENG.rc"\r
                />\r
        </Globals>\r
 </VisualStudioProject>\r
index 93b3926..90ee32d 100644 (file)
Binary files a/src/TortoiseProc/resource.h and b/src/TortoiseProc/resource.h differ