OSDN Git Service

Complete Send mail coding and mail send have some problem.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / SVNProgressDlg.cpp
index 1db965e..2d5a888 100644 (file)
@@ -40,6 +40,7 @@
 #include "ShellUpdater.h"\r
 #include "IconMenu.h"\r
 #include "BugTraqAssociations.h"\r
+#include "patch.h"\r
 \r
 static UINT WM_GITPROGRESS = RegisterWindowMessage(_T("TORTOISEGIT_GITPROGRESS_MSG"));\r
 \r
@@ -267,6 +268,10 @@ BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t actio
                        data->color = m_Colors.GetColor(CColors::Added);\r
        //      }\r
                break;\r
+       case git_wc_notify_sendmail:\r
+               data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL);\r
+               data->color = m_Colors.GetColor(CColors::Modified);\r
+               break;\r
        \r
        case git_wc_notify_resolved:\r
                data->sActionColumnText.LoadString(IDS_SVNACTION_RESOLVE);\r
@@ -896,6 +901,9 @@ UINT CGitProgressDlg::ProgressThread()
        case GitProgress_Update:\r
                bSuccess = CmdUpdate(sWindowTitle, localoperation);\r
                break;\r
+       case GitProgress_SendMail:\r
+               bSuccess = CmdSendMail(sWindowTitle, localoperation);\r
+               break;\r
        }\r
        if (!bSuccess)\r
                temp.LoadString(IDS_PROGRS_TITLEFAILED);\r
@@ -2671,3 +2679,20 @@ CString CGitProgressDlg::GetPathFromColumnText(const CString& sColumnText)
        }\r
        return sPath;\r
 }\r
+\r
+bool CGitProgressDlg::CmdSendMail(CString& sWindowTitle, bool& /*localoperation*/)\r
+{\r
+       sWindowTitle.LoadString(IDS_PROGRS_TITLE_SENDMAIL);\r
+       SetWindowText(sWindowTitle);\r
+       //SetBackgroundImage(IDI_ADD_BKG);\r
+       ReportCmd(CString(MAKEINTRESOURCE(IDS_PROGRS_CMD_SENDMAIL)));\r
+\r
+       for(int i=0;i<m_targetPathList.GetCount();i++)\r
+       {\r
+               CPatch patch;\r
+               patch.Send((CString&)m_targetPathList[i].GetWinPathString(),this->m_SendMailTO,\r
+                                 this->m_SendMailCC,this->m_SendMailFlags&SENDMAIL_ATTACHMENT);\r
+               Notify(m_targetPathList[i],git_wc_notify_sendmail);\r
+       }\r
+       return true;\r
+}
\ No newline at end of file