KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_git_commit.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#ifndef DIALOG_GIT_COMMIT_H
21#define DIALOG_GIT_COMMIT_H
22
23#include <dialog_shim.h>
24#include <git2.h>
25#include <vector>
26
27class wxCheckBox;
28class wxTextCtrl;
29class wxListCtrl;
30class wxListEvent;
31class wxButton;
32
34{
35public:
36 DIALOG_GIT_COMMIT( wxWindow* parent, git_repository* repo,
37 const wxString& defaultAuthorName,
38 const wxString& defaultAuthorEmail,
39 const std::map<wxString, int>& filesToCommit );
40
41 wxString GetCommitMessage() const;
42
44 void SetCommitMessage( const wxString& aMessage );
45
46 wxString GetAuthorName() const;
47
48 wxString GetAuthorEmail() const;
49
50 std::vector<wxString> GetSelectedFiles() const;
51
52 void OnTextChanged( wxCommandEvent& event );
53 void OnItemChecked( wxListEvent& event );
54 void OnItemUnchecked( wxListEvent& event );
55
56private:
58 wxTextCtrl* m_authorTextCtrl;
59 wxListCtrl* m_listCtrl;
60 wxButton* m_okButton;
61
62 git_repository* m_repo;
65 std::vector<wxString> m_filesToCommit;
66};
67
68#endif // DIALOG_GIT_COMMIT_H
wxTextCtrl * m_commitMessageTextCtrl
void OnTextChanged(wxCommandEvent &event)
wxString GetCommitMessage() const
wxTextCtrl * m_authorTextCtrl
DIALOG_GIT_COMMIT(wxWindow *parent, git_repository *repo, const wxString &defaultAuthorName, const wxString &defaultAuthorEmail, const std::map< wxString, int > &filesToCommit)
void OnItemChecked(wxListEvent &event)
std::vector< wxString > m_filesToCommit
void SetCommitMessage(const wxString &aMessage)
Pre-fill the commit message.
void OnItemUnchecked(wxListEvent &event)
wxString GetAuthorEmail() const
git_repository * m_repo
std::vector< wxString > GetSelectedFiles() const
wxString GetAuthorName() const
wxListCtrl * m_listCtrl
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)