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>
27#include <vector>
28
29class wxButton;
30class wxListView;
31class wxTextCtrl;
32class wxListEvent;
33
35{
36public:
37 DIALOG_GIT_SWITCH( wxWindow* aParent, std::vector<KIGIT_BRANCH_INFO> aBranches );
38 virtual ~DIALOG_GIT_SWITCH();
39
40 wxString GetBranchName() const;
41
42private:
43 void PopulateBranchList();
44 void OnBranchListSelection(wxListEvent& event);
45 void OnBranchListDClick(wxListEvent& event);
46 void OnSwitchButton(wxCommandEvent& event);
47 void OnCancelButton(wxCommandEvent& event);
48 void OnTextChanged(wxCommandEvent& event);
49 void updateSwitchButton();
50 bool branchExists( const wxString& aName ) const;
51
52 wxListView* m_branchList;
53 wxTextCtrl* m_branchNameText;
54 wxButton* m_switchButton;
56
58
60
61 std::vector<KIGIT_BRANCH_INFO> m_branches;
62};
63
64#endif // DIALOG_GIT_SWITCH_H
std::vector< KIGIT_BRANCH_INFO > m_branches
bool branchExists(const wxString &aName) const
wxListView * m_branchList
WX_DEBOUNCED_ACTION m_branchNameDebounce
wxString GetBranchName() const
void OnTextChanged(wxCommandEvent &event)
void OnCancelButton(wxCommandEvent &event)
DIALOG_GIT_SWITCH(wxWindow *aParent, std::vector< KIGIT_BRANCH_INFO > aBranches)
wxTextCtrl * m_branchNameText
void OnBranchListSelection(wxListEvent &event)
void OnBranchListDClick(wxListEvent &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)
Debounces an action: runs it only after a quiet period following the last trigger.