KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_git_switch.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
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 3
9 * of the License, or (at your option) any later version.
10 *
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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#ifndef DIALOG_GIT_SWITCH_H
22#define DIALOG_GIT_SWITCH_H
23
24#include <dialog_shim.h>
25#include <wx/timer.h>
26#include <git2.h>
27
28class wxButton;
29class wxListView;
30class wxTextCtrl;
31class wxListEvent;
32
34{
35 wxString commitString;
38};
39
41{
42public:
43 DIALOG_GIT_SWITCH(wxWindow* aParent, git_repository* aRepository);
44 virtual ~DIALOG_GIT_SWITCH();
45
46 wxString GetBranchName() const;
47
48private:
49 void PopulateBranchList();
50 void OnBranchListSelection(wxListEvent& event);
51 void OnBranchListDClick(wxListEvent& event);
52 void OnSwitchButton(wxCommandEvent& event);
53 void OnCancelButton(wxCommandEvent& event);
54 void OnTextChanged(wxCommandEvent& event);
55 void OnTimer(wxTimerEvent& event);
56 void GetBranches();
57
58 wxListView* m_branchList;
59 wxTextCtrl* m_branchNameText;
60 wxButton* m_switchButton;
61 wxTimer m_timer;
62
64
65 git_repository* m_repository;
68
69 std::map<wxString, BranchData> m_branches;
70
71 void StartTimer();
72 void StopTimer();
73};
74
75#endif // DIALOG_GIT_SWITCH_H
DIALOG_GIT_SWITCH(wxWindow *aParent, git_repository *aRepository)
wxListView * m_branchList
git_repository * m_repository
wxString GetBranchName() const
void OnTextChanged(wxCommandEvent &event)
std::map< wxString, BranchData > m_branches
void OnCancelButton(wxCommandEvent &event)
wxTextCtrl * m_branchNameText
void OnBranchListSelection(wxListEvent &event)
void OnBranchListDClick(wxListEvent &event)
void OnTimer(wxTimerEvent &event)
void OnSwitchButton(wxCommandEvent &event)
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
wxString commitString