--- /dev/null
+#include "StdAfx.h"\r
+#include "Patch.h"\r
+\r
+CPatch::CPatch()\r
+{\r
+ \r
+}\r
+\r
+CPatch::~CPatch()\r
+{\r
+ \r
+\r
+}\r
+\r
+int CPatch::Parser(CString &pathfile)\r
+{\r
+ CString str;\r
+\r
+ CStdioFile PatchFile;\r
+\r
+ m_PathFile=pathfile;\r
+ if( ! PatchFile.Open(pathfile,CFile::modeRead) )\r
+ return -1;\r
+ \r
+ int i=0;\r
+ while(PatchFile.ReadString(str))\r
+ {\r
+ if(i==1)\r
+ this->m_Author=str.Right( str.GetLength() - 6 );\r
+ if(i==2)\r
+ this->m_Date = str.Right( str.GetLength() - 6 );\r
+ if(i==3)\r
+ this->m_Subject = str.Right( str.GetLength() - 8 );\r
+ if(i==4)\r
+ break;\r
+ i++; \r
+ }\r
+\r
+\r
+ PatchFile.Close();\r
+\r
+}
\ No newline at end of file
--- /dev/null
+#pragma once\r
+\r
+class CPatch\r
+{\r
+\r
+ \r
+public:\r
+ CPatch();\r
+ ~CPatch(void);\r
+ int Parser(CString &pathfile);\r
+\r
+ CString m_Author;\r
+ CString m_Date;\r
+ CString m_Subject;\r
+ CString m_PathFile;\r
+ CString m_Body;\r
+};\r
this->GetDlgItem(IDC_SENDMAIL_SUBJECT)->EnableWindow(this->m_bCombine);\r
if(m_bCombine)\r
GetDlgItem(IDC_SENDMAIL_SUBJECT)->SetWindowText(this->m_Subject);\r
+\r
+ UpdateSubject();\r
}\r
\r
void CSendMailDlg::OnBnClickedOk()\r
{\r
\r
this->UpdateData();\r
+\r
if(this->m_To.IsEmpty() && this->m_CC.IsEmpty())\r
{\r
CMessageBox::Show(NULL,IDS_ERR_ADDRESS_NO_EMPTY,IDS_APPNAME,MB_OK|MB_ICONERROR);\r
m_AddressReg.Save();\r
} \r
\r
+ this->m_PathList.Clear();\r
+ for(int i=0;i<m_ctrlList.GetItemCount();i++)\r
+ {\r
+ CTGitPath path;\r
+ if(m_ctrlList.GetCheck(i))\r
+ {\r
+ path.SetFromWin(m_ctrlList.GetItemText(i,0));\r
+ this->m_PathList.AddPath(path);\r
+ }\r
+ }\r
OnOK();\r
// TODO: Add your control notification handler code here\r
}\r
\r
+void CSendMailDlg::UpdateSubject()\r
+{\r
+ this->UpdateData();\r
+\r
+ if(!this->m_bCombine)\r
+ {\r
+ if(m_ctrlList.GetSelectedCount()==1)\r
+ {\r
+ POSITION pos=m_ctrlList.GetFirstSelectedItemPosition();\r
+ int index=m_ctrlList.GetNextSelectedItem(pos);\r
+ if(this->m_MapPatch.find(index) == m_MapPatch.end() )\r
+ {\r
+ m_MapPatch[index].Parser(m_ctrlList.GetItemText(index,0));\r
+ }\r
+ GetDlgItem(IDC_SENDMAIL_SUBJECT)->SetWindowText(m_MapPatch[index].m_Subject);\r
+ }\r
+ else\r
+ {\r
+ GetDlgItem(IDC_SENDMAIL_SUBJECT)->SetWindowText(_T(""));\r
+ }\r
+ }\r
+}\r
+\r
void CSendMailDlg::OnLvnItemchangedSendmailPatchs(NMHDR *pNMHDR, LRESULT *pResult)\r
{\r
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);\r
+ \r
+ UpdateSubject();\r
// TODO: Add your control notification handler code here\r
\r
*pResult = 0;\r
// with the ENM_CHANGE flag ORed into the mask.\r
\r
// TODO: Add your control notification handler code here\r
- GetDlgItem(IDC_SENDMAIL_SUBJECT)->GetWindowText(this->m_Subject);\r
+ this->UpdateData();\r
+ if(this->m_bCombine)\r
+ GetDlgItem(IDC_SENDMAIL_SUBJECT)->GetWindowText(this->m_Subject);\r
}\r
#include "ACEdit.h"\r
#include "RegHistory.h"\r
#include "TGitPath.h"\r
+#include "patch.h"\r
\r
class CSendMailDlg : public CResizableStandAloneDialog\r
{\r
virtual BOOL OnInitDialog();\r
DECLARE_MESSAGE_MAP()\r
\r
+ void UpdateSubject();\r
+\r
CHyperLink m_SmtpSetup;\r
\r
CACEdit m_ctrlCC;\r
CListCtrl m_ctrlList;\r
CTGitPathList m_PathList;\r
\r
+\r
+ std::map<int,CPatch> m_MapPatch;\r
+\r
afx_msg void OnBnClickedSendmailCombine();\r
afx_msg void OnBnClickedOk();\r
afx_msg void OnLvnItemchangedSendmailPatchs(NMHDR *pNMHDR, LRESULT *pResult);\r
>\r
</File>\r
<File\r
+ RelativePath=".\Patch.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\Patch.h"\r
+ >\r
+ </File>\r
+ <File\r
RelativePath=".\ProjectProperties.cpp"\r
>\r
</File>\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