1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2012 - 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.
20 #include "TortoiseProc.h"
22 #include "SubmoduleDiffDlg.h"
24 IMPLEMENT_DYNAMIC(CSubmoduleDiffDlg
, CHorizontalResizableStandAloneDialog
)
25 CSubmoduleDiffDlg::CSubmoduleDiffDlg(CWnd
* pParent
/*=NULL*/)
26 : CHorizontalResizableStandAloneDialog(CSubmoduleDiffDlg::IDD
, pParent
)
30 CSubmoduleDiffDlg::~CSubmoduleDiffDlg()
34 void CSubmoduleDiffDlg::DoDataExchange(CDataExchange
* pDX
)
36 CHorizontalResizableStandAloneDialog::DoDataExchange(pDX
);
37 DDX_Text(pDX
, IDC_FROMHASH
, m_sFromHash
);
38 DDX_Text(pDX
, IDC_FROMSUBJECT
, m_sFromSubject
);
39 DDX_Text(pDX
, IDC_TOHASH
, m_sToHash
);
40 DDX_Text(pDX
, IDC_TOSUBJECT
, m_sToSubject
);
43 BEGIN_MESSAGE_MAP(CSubmoduleDiffDlg
, CHorizontalResizableStandAloneDialog
)
46 BOOL
CSubmoduleDiffDlg::OnInitDialog()
48 CHorizontalResizableStandAloneDialog::OnInitDialog();
51 GetWindowText(sWindowTitle
);
52 CAppUtils::SetWindowTitle(m_hWnd
, g_Git
.m_CurrentDir
, sWindowTitle
);
54 AddAnchor(IDC_FROMGROUP
, TOP_LEFT
, TOP_RIGHT
);
55 AddAnchor(IDC_TOGROUP
, TOP_LEFT
, TOP_RIGHT
);
57 AddAnchor(IDC_FROMHASH
, TOP_LEFT
, TOP_RIGHT
);
58 AddAnchor(IDC_FROMSUBJECT
, TOP_LEFT
, TOP_RIGHT
);
59 AddAnchor(IDC_TOHASH
, TOP_LEFT
, TOP_RIGHT
);
60 AddAnchor(IDC_TOSUBJECT
, TOP_LEFT
, TOP_RIGHT
);
62 EnableSaveRestore(_T("SubmoduleDiffDlg"));
64 if (m_bToIsWorkingCopy
)
67 GetDlgItem(IDC_TOGROUP
)->GetWindowText(toGroup
);
68 toGroup
+= _T(" (") + CString(MAKEINTRESOURCE(IDS_git_DEPTH_WORKING
)) + _T(")");
69 GetDlgItem(IDC_TOGROUP
)->SetWindowText(toGroup
);
72 CString title
= _T("Submodule \"") + m_sPath
+ _T("\"");
73 GetDlgItem(IDC_SUBMODULEDIFFTITLE
)->SetWindowText(title
);
80 void CSubmoduleDiffDlg::SetDiff(CString path
, bool toIsWorkingCopy
, CString fromHash
, CString fromSubject
, CString toHash
, CString toSubject
)
82 m_bToIsWorkingCopy
= toIsWorkingCopy
;
86 m_sFromHash
= fromHash
;
87 m_sFromSubject
= fromSubject
;
89 m_sToSubject
= toSubject
;