1
// TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2013-2016, 2019-2020, 2024 - 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 "LogOrdering.h"
24 IMPLEMENT_DYNAMIC(CLogOrdering
, CStandAloneDialog
)
25 CLogOrdering::CLogOrdering(CWnd
* pParent
/*=nullptr*/)
26 : CStandAloneDialog(CLogOrdering::IDD
, pParent
)
30 CLogOrdering::~CLogOrdering()
34 void CLogOrdering::DoDataExchange(CDataExchange
* pDX
)
36 CStandAloneDialog::DoDataExchange(pDX
);
37 DDX_Control(pDX
, IDC_COMBOBOXEX_ORDERING
, m_cLogOrdering
);
40 BEGIN_MESSAGE_MAP(CLogOrdering
, CStandAloneDialog
)
43 BOOL
CLogOrdering::OnInitDialog()
45 CStandAloneDialog::OnInitDialog();
47 int ind
= m_cLogOrdering
.AddString(CString(MAKEINTRESOURCE(IDS_LOG_CHRONOLOGICALREVERSEDORDER
)));
48 m_cLogOrdering
.SetItemData(ind
, CGit::LOG_ORDER_CHRONOLOGIALREVERSED
);
49 ind
= m_cLogOrdering
.AddString(L
"--topo-order " + CString(MAKEINTRESOURCE(IDS_TORTOISEGITDEFAULT
)));
50 m_cLogOrdering
.SetItemData(ind
, CGit::LOG_ORDER_TOPOORDER
);
51 ind
= m_cLogOrdering
.AddString(L
"--date-order");
52 m_cLogOrdering
.SetItemData(ind
, CGit::LOG_ORDER_DATEORDER
);
53 ind
= m_cLogOrdering
.AddString(L
"--author-date-order");
54 m_cLogOrdering
.SetItemData(ind
, CGit::LOG_ORDER_AUTHORDATEORDER
);
56 DWORD curOrder
= CRegDWORD(L
"Software\\TortoiseGit\\LogOrderBy", CGit::LOG_ORDER_TOPOORDER
);
57 for (int i
= 0; i
< m_cLogOrdering
.GetCount(); ++i
)
58 if (m_cLogOrdering
.GetItemData(i
) == curOrder
)
59 m_cLogOrdering
.SetCurSel(i
);
64 void CLogOrdering::OnOK()
66 if (m_cLogOrdering
.GetCurSel() != CB_ERR
)
67 CRegDWORD(L
"Software\\TortoiseGit\\LogOrderBy") = static_cast<DWORD
>(m_cLogOrdering
.GetItemData(m_cLogOrdering
.GetCurSel()));