OSDN Git Service

Add Miss file
authorFrank Li <lznuaa@gmail.com>
Sun, 14 Jun 2009 13:50:16 +0000 (21:50 +0800)
committerFrank Li <lznuaa@gmail.com>
Sun, 14 Jun 2009 13:50:16 +0000 (21:50 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/Commands/RefBrowseCommand.h [new file with mode: 0644]
src/TortoiseProc/Settings/SettingsBugtraqConfig.cpp [new file with mode: 0644]
src/TortoiseProc/Settings/SettingsBugtraqConfig.h [new file with mode: 0644]

diff --git a/src/TortoiseProc/Commands/RefBrowseCommand.h b/src/TortoiseProc/Commands/RefBrowseCommand.h
new file mode 100644 (file)
index 0000000..5a3ad73
--- /dev/null
@@ -0,0 +1,13 @@
+#pragma once\r
+#include "Command.h"\r
+#include "BrowseRefsDlg.h"\r
+\r
+class RefBrowseCommand : public Command\r
+{\r
+       virtual bool Execute()\r
+       {\r
+               CBrowseRefsDlg(orgCmdLinePath.GetWinPath()).DoModal();\r
+               return true;\r
+       }\r
+};\r
+       \r
diff --git a/src/TortoiseProc/Settings/SettingsBugtraqConfig.cpp b/src/TortoiseProc/Settings/SettingsBugtraqConfig.cpp
new file mode 100644 (file)
index 0000000..624d888
--- /dev/null
@@ -0,0 +1,245 @@
+// settings\SettingsBugtraqConfig.cpp : implementation file\r
+//\r
+\r
+#include "stdafx.h"\r
+#include "TortoiseProc.h"\r
+#include "settings\SettingsBugtraqConfig.h"\r
+#include "ProjectProperties.h"\r
+#include "git.h"\r
+#include "messagebox.h"\r
+// CSettingsBugtraqConfig dialog\r
+\r
+IMPLEMENT_DYNAMIC(CSettingsBugtraqConfig, ISettingsPropPage)\r
+\r
+CSettingsBugtraqConfig::CSettingsBugtraqConfig(CString cmdPath)\r
+       : ISettingsPropPage(CSettingsBugtraqConfig::IDD)        \r
+       , m_URL(_T(""))\r
+       , m_bNWarningifnoissue(FALSE)\r
+       , m_Message(_T(""))\r
+       , m_bNAppend(FALSE)\r
+       , m_Label(_T(""))\r
+       , m_bNNumber(FALSE)\r
+       , m_Logregex(_T(""))\r
+{\r
+       m_ChangeMask=0;\r
+}\r
+\r
+CSettingsBugtraqConfig::~CSettingsBugtraqConfig()\r
+{\r
+}\r
+\r
+void CSettingsBugtraqConfig::DoDataExchange(CDataExchange* pDX)\r
+{\r
+       CPropertyPage::DoDataExchange(pDX);\r
+       DDX_Text(pDX, IDC_BUGTRAQ_URL, m_URL);\r
+       DDX_Radio(pDX, IDC_BUGTRAQ_WARNINGIFNOISSUE_TRUE, m_bNWarningifnoissue);\r
+       DDX_Text(pDX, IDC_BUGTRAQ_MESSAGE, m_Message);\r
+       DDX_Radio(pDX, IDC_BUGTRAQ_APPEND_TRUE, m_bNAppend);\r
+       DDX_Text(pDX, IDC_BUGTRAQ_LABEL, m_Label);\r
+       DDX_Radio(pDX, IDC_BUGTRAQ_NUMBER_TRUE, m_bNNumber);\r
+       DDX_Text(pDX, IDC_BUGTRAQ_LOGREGEX, m_Logregex);\r
+}\r
+\r
+\r
+BEGIN_MESSAGE_MAP(CSettingsBugtraqConfig, ISettingsPropPage)\r
+\r
+       ON_EN_CHANGE(IDC_BUGTRAQ_URL, &CSettingsBugtraqConfig::OnEnChangeBugtraqUrl)\r
+       ON_BN_CLICKED(IDC_BUGTRAQ_WARNINGIFNOISSUE_TRUE, &CSettingsBugtraqConfig::OnBnClickedBugtraqWarningifnoissueTrue)\r
+       ON_BN_CLICKED(IDC_BUGTRAQ_WARNINGIFNOISSUE_FALSE, &CSettingsBugtraqConfig::OnBnClickedBugtraqWarningifnoissueFalse)\r
+       ON_EN_CHANGE(IDC_BUGTRAQ_MESSAGE, &CSettingsBugtraqConfig::OnEnChangeBugtraqMessage)\r
+       ON_BN_CLICKED(IDC_BUGTRAQ_APPEND_TRUE, &CSettingsBugtraqConfig::OnBnClickedBugtraqAppendTrue)\r
+       ON_BN_CLICKED(IDC_BUGTRAQ_APPEND_FALSE, &CSettingsBugtraqConfig::OnBnClickedBugtraqAppendFalse)\r
+       ON_EN_CHANGE(IDC_BUGTRAQ_LABEL, &CSettingsBugtraqConfig::OnEnChangeBugtraqLabel)\r
+       ON_BN_CLICKED(IDC_BUGTRAQ_NUMBER_TRUE, &CSettingsBugtraqConfig::OnBnClickedBugtraqNumberTrue)\r
+       ON_BN_CLICKED(IDC_BUGTRAQ_NUMBER_FALSE, &CSettingsBugtraqConfig::OnBnClickedBugtraqNumberFalse)\r
+       ON_EN_CHANGE(IDC_BUGTRAQ_LOGREGEX, &CSettingsBugtraqConfig::OnEnChangeBugtraqLogregex)\r
+END_MESSAGE_MAP()\r
+\r
+BOOL CSettingsBugtraqConfig::OnInitDialog()\r
+{\r
+       ISettingsPropPage::OnInitDialog();\r
+       ProjectProperties::GetStringProps(this->m_URL,_T("bugtraq.url"));\r
+       ProjectProperties::GetStringProps(this->m_Logregex,_T("bugtraq.logregex"));\r
+       ProjectProperties::GetStringProps(this->m_Label,_T("bugtraq.label"));\r
+       ProjectProperties::GetStringProps(this->m_Message,_T("bugtraq.message"));\r
+\r
+       ProjectProperties::GetBOOLProps(this->m_bNAppend,_T("bugtraq.append"));\r
+       ProjectProperties::GetBOOLProps(this->m_bNNumber,_T("bugtraq.number"));\r
+       ProjectProperties::GetBOOLProps(this->m_bNWarningifnoissue,_T("bugtraq.warnifnoissue"));\r
+       \r
+       m_bNAppend = !m_bNAppend;\r
+       m_bNNumber = !m_bNNumber;\r
+       m_bNWarningifnoissue = !m_bNWarningifnoissue;\r
+\r
+       this->UpdateData(FALSE);\r
+       return TRUE;\r
+}\r
+\r
+BOOL CSettingsBugtraqConfig::OnApply()\r
+{\r
+       this->UpdateData();\r
+\r
+       CString cmd,out;\r
+       if(m_ChangeMask & BUG_URL)\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.url \"%s\""),m_URL);\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+       }\r
+       out.Empty();\r
+       if(m_ChangeMask & BUG_WARNING)\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.warnifnoissue \"%s\""),(!this->m_bNWarningifnoissue)?_T("true"):_T("false"));\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+\r
+       }\r
+       out.Empty();\r
+       if(m_ChangeMask & BUG_MESSAGE)\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.message \"%s\""),this->m_Message);\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+\r
+       }\r
+       out.Empty();\r
+       if(m_ChangeMask & BUG_APPEND )\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.append \"%s\""),(!this->m_bNAppend)?_T("true"):_T("false"));\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+\r
+       }\r
+       out.Empty();\r
+       if(m_ChangeMask & BUG_LABEL )\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.label \"%s\""),this->m_Label);\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+\r
+       }\r
+       out.Empty();\r
+       if(m_ChangeMask &BUG_NUMBER )\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.number \"%s\""),(!this->m_bNNumber)?_T("true"):_T("false"));\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+\r
+       }\r
+       out.Empty();\r
+       if(m_ChangeMask & BUG_LOGREGEX)\r
+       {\r
+               cmd.Format(_T("git.exe config bugtraq.logregex \"%s\""),this->m_Logregex);\r
+               if(g_Git.Run(cmd,&out,CP_ACP))\r
+               {\r
+                       CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
+               }\r
+\r
+       }\r
+\r
+       m_ChangeMask= 0;\r
+       return TRUE;\r
+}\r
+// CSettingsBugtraqConfig message handlers\r
+\r
+void CSettingsBugtraqConfig::OnEnChangeBugtraqUrl()\r
+{\r
+       // TODO:  If this is a RICHEDIT control, the control will not\r
+       // send this notification unless you override the ISettingsPropPage::OnInitDialog()\r
+       // function and call CRichEditCtrl().SetEventMask()\r
+       // with the ENM_CHANGE flag ORed into the mask.\r
+\r
+       // TODO:  Add your control notification handler code here\r
+       m_ChangeMask |= BUG_URL;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnBnClickedBugtraqWarningifnoissueTrue()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       m_ChangeMask |= BUG_WARNING;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnBnClickedBugtraqWarningifnoissueFalse()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       m_ChangeMask |= BUG_WARNING;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnEnChangeBugtraqMessage()\r
+{\r
+       // TODO:  If this is a RICHEDIT control, the control will not\r
+       // send this notification unless you override the ISettingsPropPage::OnInitDialog()\r
+       // function and call CRichEditCtrl().SetEventMask()\r
+       // with the ENM_CHANGE flag ORed into the mask.\r
+\r
+       // TODO:  Add your control notification handler code here\r
+       m_ChangeMask |= BUG_MESSAGE;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnBnClickedBugtraqAppendTrue()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       m_ChangeMask |= BUG_APPEND;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnBnClickedBugtraqAppendFalse()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       m_ChangeMask |= BUG_APPEND;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnEnChangeBugtraqLabel()\r
+{\r
+       // TODO:  If this is a RICHEDIT control, the control will not\r
+       // send this notification unless you override the ISettingsPropPage::OnInitDialog()\r
+       // function and call CRichEditCtrl().SetEventMask()\r
+       // with the ENM_CHANGE flag ORed into the mask.\r
+\r
+       // TODO:  Add your control notification handler code here\r
+       m_ChangeMask |= BUG_LABEL;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnBnClickedBugtraqNumberTrue()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       m_ChangeMask |= BUG_NUMBER;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnBnClickedBugtraqNumberFalse()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       m_ChangeMask |= BUG_NUMBER;\r
+       SetModified();\r
+}\r
+\r
+void CSettingsBugtraqConfig::OnEnChangeBugtraqLogregex()\r
+{\r
+       // TODO:  If this is a RICHEDIT control, the control will not\r
+       // send this notification unless you override the ISettingsPropPage::OnInitDialog()\r
+       // function and call CRichEditCtrl().SetEventMask()\r
+       // with the ENM_CHANGE flag ORed into the mask.\r
+\r
+       // TODO:  Add your control notification handler code here\r
+       m_ChangeMask |= BUG_LOGREGEX;\r
+       SetModified();\r
+}\r
diff --git a/src/TortoiseProc/Settings/SettingsBugtraqConfig.h b/src/TortoiseProc/Settings/SettingsBugtraqConfig.h
new file mode 100644 (file)
index 0000000..fbea565
--- /dev/null
@@ -0,0 +1,56 @@
+#pragma once\r
+\r
+#include "SettingsPropPage.h"\r
+// CSettingsBugtraqConfig dialog \r
+\r
+class CSettingsBugtraqConfig : public ISettingsPropPage\r
+{\r
+       DECLARE_DYNAMIC(CSettingsBugtraqConfig)\r
+\r
+public:\r
+       CSettingsBugtraqConfig(CString cmdPath);\r
+       virtual ~CSettingsBugtraqConfig();\r
+\r
+// Dialog Data\r
+       enum { IDD = IDD_SETTINGSBUGTRAQ_CONFIG };\r
+       UINT GetIconID() {return IDI_BUGTRAQ;}\r
+\r
+protected:\r
+       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
+\r
+       virtual BOOL OnInitDialog();\r
+       virtual BOOL OnApply();\r
+\r
+       int m_ChangeMask;\r
+\r
+       enum\r
+       {\r
+               BUG_URL=0x1,\r
+               BUG_MESSAGE=0x2,\r
+               BUG_APPEND=0x4,\r
+               BUG_LABEL=0x8,\r
+               BUG_NUMBER=0x10,\r
+               BUG_LOGREGEX=0x20,\r
+               BUG_WARNING=0x40,\r
+       };\r
+       DECLARE_MESSAGE_MAP()\r
+\r
+public:\r
+       CString m_URL;\r
+       BOOL m_bNWarningifnoissue;\r
+       CString m_Message;\r
+       BOOL m_bNAppend;\r
+       CString m_Label;\r
+       BOOL m_bNNumber;\r
+       CString m_Logregex;\r
+       afx_msg void OnEnChangeBugtraqUrl();\r
+       afx_msg void OnBnClickedBugtraqWarningifnoissueTrue();\r
+       afx_msg void OnBnClickedBugtraqWarningifnoissueFalse();\r
+       afx_msg void OnEnChangeBugtraqMessage();\r
+       afx_msg void OnBnClickedBugtraqAppendTrue();\r
+       afx_msg void OnBnClickedBugtraqAppendFalse();\r
+       afx_msg void OnEnChangeBugtraqLabel();\r
+       afx_msg void OnBnClickedBugtraqNumberTrue();\r
+       afx_msg void OnBnClickedBugtraqNumberFalse();\r
+       afx_msg void OnEnChangeBugtraqLogregex();\r
+};\r