OSDN Git Service

BrowseRefs: Removed unused confirm dialog
authorJohan 't Hart <johanthart@gmail.com>
Sat, 9 May 2009 13:02:06 +0000 (15:02 +0200)
committerFrank Li <lznuaa@gmail.com>
Sat, 9 May 2009 13:25:32 +0000 (21:25 +0800)
src/TortoiseProc/BrowseRefsDlg.cpp
src/TortoiseProc/ConfirmDelRefDlg.cpp [deleted file]
src/TortoiseProc/ConfirmDelRefDlg.h [deleted file]
src/TortoiseProc/TortoiseProc.vcproj

index a2d21b1..915b5cf 100644 (file)
@@ -9,7 +9,6 @@
 #include "CreateBranchTagDlg.h"\r
 #include "Settings\SettingGitRemote.h"\r
 #include "SinglePropSheetDlg.h"\r
-#include "ConfirmDelRefDlg.h"\r
 #include "MessageBox.h"\r
 \r
 // CBrowseRefsDlg dialog\r
diff --git a/src/TortoiseProc/ConfirmDelRefDlg.cpp b/src/TortoiseProc/ConfirmDelRefDlg.cpp
deleted file mode 100644 (file)
index 943c0b0..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-// ConfirmDelRefDlg.cpp : implementation file\r
-//\r
-\r
-#include "stdafx.h"\r
-#include "TortoiseProc.h"\r
-#include "ConfirmDelRefDlg.h"\r
-#include "Git.h"\r
-\r
-\r
-// CConfirmDelRefDlg dialog\r
-\r
-IMPLEMENT_DYNAMIC(CConfirmDelRefDlg, CDialog)\r
-\r
-CConfirmDelRefDlg::CConfirmDelRefDlg(CString completeRefName, CWnd* pParent /*=NULL*/)\r
-:      CDialog(CConfirmDelRefDlg::IDD, pParent),\r
-       m_completeRefName(completeRefName)\r
-{\r
-\r
-}\r
-\r
-CConfirmDelRefDlg::~CConfirmDelRefDlg()\r
-{\r
-}\r
-\r
-void CConfirmDelRefDlg::DoDataExchange(CDataExchange* pDX)\r
-{\r
-       CDialog::DoDataExchange(pDX);\r
-       DDX_Control(pDX, IDC_CHECK_FORCE, m_butForce);\r
-       DDX_Control(pDX, IDC_STATIC_MESSAGE, m_statMessage);\r
-       DDX_Control(pDX, IDOK, m_butOK);\r
-}\r
-\r
-\r
-BEGIN_MESSAGE_MAP(CConfirmDelRefDlg, CDialog)\r
-       ON_BN_CLICKED(IDC_CHECK_FORCE, OnBnForce)\r
-END_MESSAGE_MAP()\r
-\r
-\r
-// CConfirmDelRefDlg message handlers\r
-\r
-BOOL CConfirmDelRefDlg::OnInitDialog()\r
-{\r
-       CDialog::OnInitDialog();\r
-       CString csMessage;\r
-\r
-       csMessage=L"Are you sure you want to delete the ";\r
-       if(wcsncmp(m_completeRefName,L"refs/heads",10)==0)\r
-       {\r
-               SetWindowText(L"Confirm deletion of branch " + m_completeRefName);\r
-               csMessage += "branch '";\r
-               csMessage += m_completeRefName;\r
-               csMessage += "'?";\r
-\r
-               //Check if branch is fully merged in HEAD\r
-               CString branchHash = g_Git.GetHash(m_completeRefName);\r
-               CString commonAncestor;\r
-               CString cmd;\r
-               cmd.Format(L"git.exe merge-base HEAD %s",m_completeRefName);\r
-               g_Git.Run(cmd,&commonAncestor,CP_UTF8);\r
-\r
-               branchHash=branchHash.Left(40);\r
-               commonAncestor=commonAncestor.Left(40);\r
-               \r
-               if(commonAncestor != branchHash)\r
-               {\r
-                       m_butForce.ShowWindow(SW_SHOW);\r
-                       m_butOK.EnableWindow(FALSE);\r
-                       csMessage += L"\r\n\r\nWarning: this branch is not fully merged into HEAD. If you realy want to delete this branch, check the force flag.";\r
-               }\r
-       }\r
-       else if(wcsncmp(m_completeRefName,L"refs/tags",9)==0)\r
-       {\r
-               SetWindowText(L"Confirm deletion of tag " + m_completeRefName);\r
-               csMessage += "tag '";\r
-               csMessage += m_completeRefName;\r
-               csMessage += "'?";\r
-       }\r
-\r
-       m_statMessage.SetWindowText(csMessage);\r
-\r
-       return TRUE;\r
-}\r
-\r
-void CConfirmDelRefDlg::OnOK()\r
-{\r
-       bool bForce = m_butForce.GetCheck()!=0;\r
-\r
-       if(wcsncmp(m_completeRefName,L"refs/heads",10)==0)\r
-       {\r
-               CString branchToDelete = m_completeRefName.Mid(11);\r
-               CString cmd;\r
-               cmd.Format(L"git.exe branch -%c %s",bForce?L'D':L'd',branchToDelete);\r
-               CString resultDummy;\r
-               g_Git.Run(cmd,&resultDummy,CP_UTF8);\r
-       }\r
-       else if(wcsncmp(m_completeRefName,L"refs/tags",9)==0)\r
-       {\r
-               CString tagToDelete = m_completeRefName.Mid(10);\r
-               CString cmd;\r
-               cmd.Format(L"git.exe tag -d %s",tagToDelete);\r
-               CString resultDummy;\r
-               g_Git.Run(cmd,&resultDummy,CP_UTF8);\r
-       }\r
-\r
-       CDialog::OnOK();\r
-}\r
-\r
-void CConfirmDelRefDlg::OnBnForce()\r
-{\r
-       if(m_butForce.GetCheck()!=0)\r
-               m_butOK.EnableWindow(TRUE);\r
-       else if(wcsncmp(m_completeRefName,L"refs/heads",10)==0)\r
-               m_butOK.EnableWindow(FALSE);\r
-}
\ No newline at end of file
diff --git a/src/TortoiseProc/ConfirmDelRefDlg.h b/src/TortoiseProc/ConfirmDelRefDlg.h
deleted file mode 100644 (file)
index dba730b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#pragma once\r
-#include "afxwin.h"\r
-\r
-\r
-// CConfirmDelRefDlg dialog\r
-\r
-class CConfirmDelRefDlg : public CDialog\r
-{\r
-       DECLARE_DYNAMIC(CConfirmDelRefDlg)\r
-\r
-public:\r
-       CConfirmDelRefDlg(CString completeRefName, CWnd* pParent = NULL);   // standard constructor\r
-       virtual ~CConfirmDelRefDlg();\r
-\r
-// Dialog Data\r
-       enum { IDD = IDD_DIALOG_DELETE_REF };\r
-\r
-protected:\r
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
-\r
-       DECLARE_MESSAGE_MAP()\r
-public:\r
-       virtual BOOL OnInitDialog();\r
-\r
-private:\r
-       CString m_completeRefName;\r
-public:\r
-       CButton m_butForce;\r
-       CStatic m_statMessage;\r
-       CButton m_butOK;\r
-protected:\r
-       virtual void OnOK();\r
-       virtual void OnBnForce();\r
-};\r
index a9af9fc..1f4cade 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\ConfirmDelRefDlg.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\ConfirmDelRefDlg.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath=".\LogFile.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