OSDN Git Service

Send email to multi person success and add CC and TO list
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / SVNProgressDlg.cpp
index 2d5a888..febe50b 100644 (file)
@@ -217,7 +217,9 @@ void CGitProgressDlg::AddItemToList()
 }\r
 \r
 \r
-BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t action\r
+BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t action,\r
+                                                        int status ,\r
+                                                        CString *strErr \r
                                                         /*\r
                                                         svn_node_kind_t kind, const CString& mime_type, \r
                                                         svn_wc_notify_state_t content_state, \r
@@ -234,6 +236,7 @@ BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t actio
        data->path = path;\r
        data->action = action;\r
        data->sPathColumnText=path.GetGitPathString();\r
+       data->bAuxItem = false;\r
 #if 0\r
        data->kind = kind;\r
        data->mime_type = mime_type;\r
@@ -268,11 +271,30 @@ 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
+       case git_wc_notify_sendmail_start:\r
+               data->bAuxItem = true;\r
+               data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_START);\r
                data->color = m_Colors.GetColor(CColors::Modified);\r
                break;\r
        \r
+       case git_wc_notify_sendmail_error:\r
+               data->bAuxItem = true;\r
+               data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_ERROR);\r
+               if(strErr)\r
+                       data->sPathColumnText = *strErr;\r
+               else\r
+                       data->sPathColumnText.Empty();\r
+               data->color = m_Colors.GetColor(CColors::Modified);\r
+               break;\r
+\r
+       case git_wc_notify_sendmail_done:\r
+               \r
+               data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_DONE);\r
+               data->sPathColumnText.Empty();\r
+               data->color = m_Colors.GetColor(CColors::Modified);\r
+               break;\r
+\r
+\r
        case git_wc_notify_resolved:\r
                data->sActionColumnText.LoadString(IDS_SVNACTION_RESOLVE);\r
                break;\r
@@ -493,7 +515,7 @@ BOOL CGitProgressDlg::Notify(const CTGitPath& path, git_wc_notify_action_t actio
                {\r
                        m_arData.push_back(data);\r
                        AddItemToList();\r
-                       if (/*(!data->bAuxItem)&&*/(m_itemCount > 0))\r
+                       if ((!data->bAuxItem) && (m_itemCount > 0))\r
                        {\r
                                m_itemCount--;\r
 \r
@@ -2690,9 +2712,14 @@ bool CGitProgressDlg::CmdSendMail(CString& sWindowTitle, bool& /*localoperation*
        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
+               Notify(m_targetPathList[i],git_wc_notify_sendmail_start);\r
+               int ret=patch.Send((CString&)m_targetPathList[i].GetWinPathString(),this->m_SendMailTO,\r
+                                this->m_SendMailCC,this->m_SendMailFlags&SENDMAIL_ATTACHMENT);\r
+               if(ret)\r
+               {\r
+                       Notify(m_targetPathList[i],git_wc_notify_sendmail_error,ret,&patch.m_LastError);\r
+               }\r
+               Notify(m_targetPathList[i],git_wc_notify_sendmail_done,ret);\r
        }\r
        return true;\r
 }
\ No newline at end of file