Fixed issue #2495: "Show Reflog" dialog shows empty action for "push" entries
[TortoiseGit.git] / src / TortoiseProc / DeleteConflictDlg.cpp
blob1892b6db73a3b770b835d03184c53bce6d979ef4
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2009-2012, 2014-2015 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // DeleteConflictDlg.cpp : implementation file
22 #include "stdafx.h"
23 #include "resource.h"
24 #include "DeleteConflictDlg.h"
25 #include "AppUtils.h"
26 #include "Git.h"
28 // CDeleteConflictDlg dialog
30 IMPLEMENT_DYNAMIC(CDeleteConflictDlg, CStandAloneDialog)
32 CDeleteConflictDlg::CDeleteConflictDlg(CWnd* pParent /*=NULL*/)
33 : CStandAloneDialog(CDeleteConflictDlg::IDD, pParent)
35 , m_LocalStatus(_T(""))
36 , m_RemoteStatus(_T(""))
38 m_bShowModifiedButton = FALSE;
39 m_bIsDelete =FALSE;
42 CDeleteConflictDlg::~CDeleteConflictDlg()
46 void CDeleteConflictDlg::DoDataExchange(CDataExchange* pDX)
48 CDialog::DoDataExchange(pDX);
50 DDX_Text(pDX, IDC_LOCAL_STATUS, m_LocalStatus);
51 DDX_Text(pDX, IDC_REMOTE_STATUS, m_RemoteStatus);
52 DDX_Text(pDX, IDC_FROMHASH, m_LocalHash);
53 DDX_Text(pDX, IDC_TOHASH, m_RemoteHash);
57 BEGIN_MESSAGE_MAP(CDeleteConflictDlg, CStandAloneDialog)
58 ON_BN_CLICKED(IDC_LOG, OnBnClickedLog)
59 ON_BN_CLICKED(IDC_LOG2, OnBnClickedLog2)
60 ON_BN_CLICKED(IDC_DELETE, &CDeleteConflictDlg::OnBnClickedDelete)
61 ON_BN_CLICKED(IDC_MODIFY, &CDeleteConflictDlg::OnBnClickedModify)
62 ON_BN_CLICKED(IDHELP, &OnHelp)
63 END_MESSAGE_MAP()
66 BOOL CDeleteConflictDlg::OnInitDialog()
68 CStandAloneDialog::OnInitDialog();
70 if(this->m_bShowModifiedButton )
71 this->GetDlgItem(IDC_MODIFY)->SetWindowText(CString(MAKEINTRESOURCE(IDS_SVNACTION_MODIFIED)));
72 else
73 this->GetDlgItem(IDC_MODIFY)->SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_CREATED)));
74 if (m_LocalHash.IsEmpty())
75 GetDlgItem(IDC_LOG)->ShowWindow(SW_HIDE);
76 if (m_RemoteHash.IsEmpty())
77 GetDlgItem(IDC_LOG2)->ShowWindow(SW_HIDE);
79 CString sWindowTitle;
80 GetWindowText(sWindowTitle);
81 CAppUtils::SetWindowTitle(m_hWnd, this->m_File, sWindowTitle);
83 GetDlgItem(IDC_INFOLABEL)->SetWindowText(m_File);
85 GetDlgItem(IDCANCEL)->SetFocus();
87 return FALSE;
89 // CDeleteConflictDlg message handlers
91 void CDeleteConflictDlg::OnBnClickedLog()
93 ShowLog(m_LocalHash);
96 void CDeleteConflictDlg::OnBnClickedLog2()
98 ShowLog(m_RemoteHash);
101 void CDeleteConflictDlg::OnBnClickedDelete()
103 m_bIsDelete = TRUE;
104 OnOK();
107 void CDeleteConflictDlg::OnBnClickedModify()
109 m_bIsDelete = FALSE;
110 OnOK();
113 void CDeleteConflictDlg::ShowLog(CString hash)
115 CString sCmd;
116 sCmd.Format(_T("/command:log /path:\"%s\" /endrev:%s"), g_Git.CombinePath(m_File), hash);
117 CAppUtils::RunTortoiseGitProc(sCmd, false, false);