From 9bcfda927c6669a33520be4cf544c3ed5056718c Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 9 Mar 2013 19:44:50 +0100 Subject: [PATCH] CGitProgressList: Harmonized output of statuses of sendmail cmd Signed-off-by: Sven Strickroth --- Languages/Tortoise.pot | 6 +++- src/Resources/TortoiseProcENG.rc | 4 +-- src/TortoiseProc/GitProgressList.cpp | 59 +++++++++++------------------------- src/TortoiseProc/GitProgressList.h | 9 ++---- src/TortoiseProc/resource.h | 2 -- 5 files changed, 26 insertions(+), 54 deletions(-) diff --git a/Languages/Tortoise.pot b/Languages/Tortoise.pot index 65296df90..4ec11e4c9 100644 --- a/Languages/Tortoise.pot +++ b/Languages/Tortoise.pot @@ -6846,7 +6846,7 @@ msgid "Retry" msgstr "" #. Resource IDs: (602) -msgid "Retrying..." +msgid "Retrying in 2 seconds..." msgstr "" #. Resource IDs: (77, 175, 229) @@ -8672,6 +8672,10 @@ msgstr "" msgid "Up" msgstr "" +#. Resource IDs: (1710) +msgid "Update" +msgstr "" + #. Resource IDs: (607) msgid "Update Ref" msgstr "" diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index eba2c0789..730ec5943 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -3800,9 +3800,7 @@ BEGIN IDS_SVNACTION_SENDMAIL_START "Sending..." IDS_PROGRS_TITLE_SENDMAIL "Send Patch by Email" IDS_PROGRS_CMD_SENDMAIL "Send Email" - IDS_SVNACTION_SENDMAIL_ERROR "Error" - IDS_SVNACTION_SENDMAIL_DONE "Done" - IDS_SVNACTION_SENDMAIL_RETRY "Retrying..." + IDS_SVNACTION_SENDMAIL_RETRY "Retrying in 2 seconds..." END STRINGTABLE diff --git a/src/TortoiseProc/GitProgressList.cpp b/src/TortoiseProc/GitProgressList.cpp index 71ef7a837..fcf3f9aea 100644 --- a/src/TortoiseProc/GitProgressList.cpp +++ b/src/TortoiseProc/GitProgressList.cpp @@ -208,9 +208,7 @@ void CGitProgressList::AddItemToList() } -BOOL CGitProgressList::Notify(const CTGitPath& path, git_wc_notify_action_t action, - int /*status*/ , - CString *strErr +BOOL CGitProgressList::Notify(const CTGitPath& path, git_wc_notify_action_t action /* svn_node_kind_t kind, const CString& mime_type, svn_wc_notify_state_t content_state, @@ -266,36 +264,12 @@ BOOL CGitProgressList::Notify(const CTGitPath& path, git_wc_notify_action_t acti data->color = m_Colors.GetColor(CColors::Added); // } break; - case git_wc_notify_sendmail_start: + case git_wc_notify_sendmail: data->bAuxItem = true; data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_START); data->color = m_Colors.GetColor(CColors::Modified); break; - case git_wc_notify_sendmail_error: - data->bAuxItem = true; - data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_ERROR); - if(strErr) - data->sPathColumnText = *strErr; - else - data->sPathColumnText.Empty(); - data->color = m_Colors.GetColor(CColors::Modified); - break; - - case git_wc_notify_sendmail_done: - - data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_DONE); - data->sPathColumnText.Empty(); - data->color = m_Colors.GetColor(CColors::Modified); - break; - - case git_wc_notify_sendmail_retry: - data->sActionColumnText.LoadString(IDS_SVNACTION_SENDMAIL_RETRY); - data->sPathColumnText.Empty(); - data->color = m_Colors.GetColor(CColors::Modified); - break; - - case git_wc_notify_resolved: data->sActionColumnText.LoadString(IDS_SVNACTION_RESOLVE); break; @@ -2158,14 +2132,14 @@ bool CGitProgressList::CmdSendMail(CString& sWindowTitle, bool& /*localoperation { CString error; CTGitPath path; - Notify(path,git_wc_notify_sendmail_start); + Notify(path, git_wc_notify_sendmail); CString err; int retry=0; while(retry <3) { if(!!CPatch::SendPatchesCombined(m_targetPathList,m_SendMailTO,m_SendMailCC,m_SendMailSubject,!!(this->m_SendMailFlags&SENDMAIL_ATTACHMENT),!!(this->m_SendMailFlags&SENDMAIL_MAPI),&err)) { - Notify(path,git_wc_notify_sendmail_error,ret,&err); + ReportError(err); ret = false; } else @@ -2175,16 +2149,18 @@ bool CGitProgressList::CmdSendMail(CString& sWindowTitle, bool& /*localoperation ++retry; if (retry < 3) - Notify(path,git_wc_notify_sendmail_retry,ret,&err); - Sleep(2000); + { + CString retry; + retry.LoadString(IDS_SVNACTION_SENDMAIL_RETRY); + ReportNotification(retry); + Sleep(2000); + } if(m_bCancelled) { ReportUserCanceled(); return false; } } - if (ret) - Notify(path,git_wc_notify_sendmail_done,ret); } else { @@ -2192,7 +2168,7 @@ bool CGitProgressList::CmdSendMail(CString& sWindowTitle, bool& /*localoperation for (m_itemCount = 0; ret && m_itemCount < m_itemCountTotal; ++m_itemCount) { CPatch patch; - Notify(m_targetPathList[m_itemCount], git_wc_notify_sendmail_start); + Notify(m_targetPathList[m_itemCount], git_wc_notify_sendmail); int retry=0; while(retry<3) @@ -2200,9 +2176,8 @@ bool CGitProgressList::CmdSendMail(CString& sWindowTitle, bool& /*localoperation if(!!patch.Send((CString&)m_targetPathList[m_itemCount].GetWinPathString(),this->m_SendMailTO, this->m_SendMailCC,!!(this->m_SendMailFlags&SENDMAIL_ATTACHMENT),!!(this->m_SendMailFlags&SENDMAIL_MAPI))) { - Notify(m_targetPathList[m_itemCount], git_wc_notify_sendmail_error, ret, &patch.m_LastError); + ReportError(patch.m_LastError); ret = false; - } else { @@ -2211,16 +2186,18 @@ bool CGitProgressList::CmdSendMail(CString& sWindowTitle, bool& /*localoperation } ++retry; if (retry < 3) - Notify(m_targetPathList[m_itemCount], git_wc_notify_sendmail_retry, ret, &patch.m_LastError); - Sleep(2000); + { + CString retry; + retry.LoadString(IDS_SVNACTION_SENDMAIL_RETRY); + ReportNotification(retry); + Sleep(2000); + } if(m_bCancelled) { ReportUserCanceled(); return false; } } - if (ret) - Notify(m_targetPathList[m_itemCount], git_wc_notify_sendmail_done, ret); } } return ret; diff --git a/src/TortoiseProc/GitProgressList.h b/src/TortoiseProc/GitProgressList.h index 5276aee1d..2b3cb0d43 100644 --- a/src/TortoiseProc/GitProgressList.h +++ b/src/TortoiseProc/GitProgressList.h @@ -66,10 +66,7 @@ typedef enum typedef enum { git_wc_notify_add, - git_wc_notify_sendmail_start, - git_wc_notify_sendmail_error, - git_wc_notify_sendmail_retry, - git_wc_notify_sendmail_done, + git_wc_notify_sendmail, git_wc_notify_resolved, git_wc_notify_revert, git_wc_notify_fetch, @@ -212,9 +209,7 @@ protected: public: //Need update in the future implement the virtual methods from Git base class virtual BOOL Notify(const CTGitPath& path, - git_wc_notify_action_t action, - int status = 0, - CString *strErr =NULL + git_wc_notify_action_t action /* git_node_kind_t kind, const CString& mime_type, git_wc_notify_state_t content_state, diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index d8b5d4e77..6cfada614 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -1611,8 +1611,6 @@ #define IDS_SVNACTION_SENDMAIL_START 9624 #define IDS_PROGRS_TITLE_SENDMAIL 9625 #define IDS_PROGRS_CMD_SENDMAIL 9626 -#define IDS_SVNACTION_SENDMAIL_ERROR 9627 -#define IDS_SVNACTION_SENDMAIL_DONE 9628 #define IDS_SVNACTION_SENDMAIL_RETRY 9629 #define IDS_ERR_PAGEANT 9632 #define IDS_MENU_VIEWPATCH 9633 -- 2.11.4.GIT