Fixed issue #4145: "Push default" option for remote resetted after adding a new remote
[TortoiseGit.git] / src / TortoiseProc / RevisionGraph / RevisionGraphDlg.h
blob59ef5bfb08a82e2259b7d98992a50583351736d8
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2009, 2011 - TortoiseSVN
4 // Copyright (C) 2012, 2018-2020, 2023 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include "StandAloneDlg.h"
22 //#include "RevisionGraph/AllGraphOptions.h"
23 #include "ProgressDlg.h"
24 #include "Colors.h"
25 #include "RevisionGraphWnd.h"
26 #include "StandAloneDlg.h"
27 #include "FindDlg.h"
29 /**
30 * \ingroup TortoiseProc
31 * Helper class extending CToolBar, needed only to have the toolbar include
32 * a combobox.
34 class CRevGraphToolBar : public CToolBar
36 public:
37 CComboBoxEx m_ZoomCombo;
40 /**
41 * \ingroup TortoiseProc
42 * A dialog showing a revision graph.
44 * The analyzation of the log data is done in the child class CRevisionGraph,
45 * the drawing is done in the member class CRevisionGraphWnd
46 * Here, we handle window messages.
48 class CRevisionGraphDlg : public CResizableStandAloneDialog
50 DECLARE_DYNAMIC(CRevisionGraphDlg)
51 public:
52 CRevisionGraphDlg(CWnd* pParent = nullptr); // standard constructor
53 virtual ~CRevisionGraphDlg();
54 enum { IDD = IDD_REVISIONGRAPH };
57 void SetPath(const CString& sPath) {m_Graph.m_sPath = sPath;}
58 // void SetPegRevision(SVNRev revision) {m_Graph.m_pegRev = revision;}
59 void DoZoom (float factor);
61 void UpdateFullHistory();
62 void StartWorkerThread();
64 void StartHidden() { m_bVisible = false; }
65 void SetOutputFile(const CString& path) { m_outputPath = path; }
66 CString GetOutputFile() const { return m_outputPath; }
68 protected:
69 bool m_bFetchLogs;
70 char m_szTip[MAX_TT_LENGTH+1];
71 wchar_t m_wszTip[MAX_TT_LENGTH+1];
73 CString m_sFilter;
75 HACCEL m_hAccel = nullptr;
77 BOOL InitializeToolbar();
78 bool InitialSetMenu(const CString& settingName, bool defaultValue, int nId);
79 bool ToggleSetMenu(const CString& settingName, int nId);
81 void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
82 BOOL OnInitDialog() override;
83 void OnCancel() override;
84 void OnOK() override;
85 BOOL PreTranslateMessage(MSG* pMsg) override;
86 afx_msg void OnSize(UINT nType, int cx, int cy);
87 afx_msg void OnViewFilter();
88 afx_msg void OnViewZoomin();
89 afx_msg void OnViewZoomout();
90 afx_msg void OnViewZoom100();
91 afx_msg void OnViewZoomHeight();
92 afx_msg void OnViewZoomWidth();
93 afx_msg void OnViewZoomAll();
94 afx_msg void OnViewCompareheadrevisions();
95 afx_msg void OnViewComparerevisions();
96 afx_msg void OnViewUnifieddiff();
97 afx_msg void OnViewUnifieddiffofheadrevisions();
98 afx_msg void OnViewShowBranchingsMerges();
99 afx_msg void OnViewShowAllTags();
100 afx_msg void OnViewArrowPointToMerges();
101 afx_msg void OnViewShowoverview();
102 afx_msg void OnFileSavegraphas();
103 afx_msg void OnMenuexit();
104 afx_msg void OnMenuhelp();
105 afx_msg void OnChangeZoom();
106 afx_msg BOOL OnToolTipNotify (UINT id, NMHDR *pNMHDR, LRESULT *pResult);
107 afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
108 afx_msg LRESULT OnDPIChanged(WPARAM, LPARAM lParam);
110 CFindDlg* m_pFindDialog = nullptr;
111 static const UINT m_FindDialogMessage;
112 afx_msg void OnFind();
113 afx_msg LRESULT OnFindDialogMessage(WPARAM wParam, LPARAM lParam);
114 int m_nSearchIndex = 0;
116 DECLARE_MESSAGE_MAP()
118 CRect GetGraphRect();
119 void UpdateStatusBar();
121 private:
122 void UpdateZoomBox();
124 bool UpdateData();
125 void SetTheme(bool bDark) override;
127 float m_fZoomFactor;
128 CRevisionGraphWnd m_Graph;
129 CStatusBarCtrl m_StatusBar;
130 CRevGraphToolBar m_ToolBar;
131 bool m_bVisible;
132 CString m_outputPath;
133 ULONG_PTR m_gdiPlusToken = 0;
134 CComPtr<ITaskbarList3> m_pTaskbarList;