IMPLEMENT_DYNAMIC(CGitProgressDlg, CResizableStandAloneDialog)\r
CGitProgressDlg::CGitProgressDlg(CWnd* pParent /*=NULL*/)\r
: CResizableStandAloneDialog(CGitProgressDlg::IDD, pParent)\r
+ , m_bCancelled(FALSE)\r
+ , m_pThread(NULL)\r
#if 0\r
, m_Revision(_T("HEAD"))\r
//, m_RevisionEnd(0)\r
, m_bLockWarning(false)\r
, m_bLockExists(false)\r
- , m_bCancelled(FALSE)\r
, m_bThreadRunning(FALSE)\r
, m_nConflicts(0)\r
, m_bErrorsOccurred(FALSE)\r
, m_bMergesAddsDeletesOccurred(FALSE)\r
- , m_pThread(NULL)\r
+ \r
, m_options(ProgOptNone)\r
, m_dwCloseOnEnd((DWORD)-1)\r
, m_bFinishedItemAdded(false)\r
}\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
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
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
+ case git_wc_notify_sendmail_retry:\r
+ data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_RETRY);\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
{\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
SetWindowText(sWindowTitle);\r
//SetBackgroundImage(IDI_ADD_BKG);\r
ReportCmd(CString(MAKEINTRESOURCE(IDS_PROGRS_CMD_SENDMAIL)));\r
+ bool ret=true;\r
+ if(this->m_SendMailFlags&SENDMAIL_COMBINED)\r
+ {\r
+ CString error;\r
+ CTGitPath path;\r
+ Notify(path,git_wc_notify_sendmail_start);\r
+ CString err;\r
+ int retry=0;\r
+ while(retry <3)\r
+ {\r
+ if(CPatch::Send(m_targetPathList,m_SendMailTO,m_SendMailCC,m_SendMailSubject,this->m_SendMailFlags&SENDMAIL_ATTACHMENT,&err))\r
+ {\r
+ Notify(path,git_wc_notify_sendmail_error,ret,&err);\r
+ ret = false;\r
+ }\r
+ else\r
+ {\r
+ break; \r
+ }\r
\r
- for(int i=0;i<m_targetPathList.GetCount();i++)\r
+ retry++;\r
+ Sleep(2000);\r
+ if(m_bCancelled)\r
+ {\r
+ Notify(path,git_wc_notify_sendmail_retry,ret,&CString("User Canceled"));\r
+ return false;\r
+ }\r
+ }\r
+ Notify(path,git_wc_notify_sendmail_done,ret);\r
+\r
+ }else\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
+ for(int i=0;i<m_targetPathList.GetCount();i++)\r
+ {\r
+ CPatch patch;\r
+ Notify(m_targetPathList[i],git_wc_notify_sendmail_start);\r
+\r
+ int retry=0;\r
+ while(retry<3)\r
+ {\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
+ ret = false;\r
+\r
+ }else\r
+ {\r
+ break;\r
+ }\r
+ Notify(m_targetPathList[i],git_wc_notify_sendmail_retry,ret,&patch.m_LastError);\r
+\r
+ retry++;\r
+ Sleep(2000);\r
+ if(m_bCancelled)\r
+ {\r
+ Notify(m_targetPathList[i],git_wc_notify_sendmail_retry,ret,&CString("User Canceled"));\r
+ return false;\r
+ }\r
+ }\r
+ Notify(m_targetPathList[i],git_wc_notify_sendmail_done,ret);\r
+ \r
+ }\r
}\r
- return true;\r
+ return ret;\r
}
\ No newline at end of file