Debian Codegraph @

git/gitCommitDlg.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : gitCommitDlg.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 //////////////////////////////////////////////////////////////////////////////
27 //////////////////////////////////////////////////////////////////////////////
28 //
29 // copyright : (C) 2011 by René Kraus (aka upCASE)
30 //
31 //////////////////////////////////////////////////////////////////////////////
32
33 #ifndef __gitCommitDlg__
34 #define __gitCommitDlg__
35
36 #include "clEditorEditEventsHandler.h"
37 #include "gitui.h"
38 #include "macros.h"
39
40 #include <map>
41 #include <wx/tokenzr.h>
42
43 class GitPlugin;
44
45 class GitCommitDlg : public GitCommitDlgBase
46 {
47 GitPlugin* m_plugin;
48 wxString m_workingDir;
49 wxStringMap_t m_diffMap;
50 bool m_toggleChecks;
51 clEditEventsHandler::Ptr_t m_editEventsHandlerDiffStc;
52 wxString m_previousCommitMessage;
53 wxArrayString m_history;
54 wxString m_stashedMessage;
55
56 public:
57 GitCommitDlg(wxWindow* parent, GitPlugin* plugin, const wxString& workingDir);
58 virtual ~GitCommitDlg();
59
60 void AppendDiff(const wxString& diff);
61
62 wxArrayString GetSelectedFiles();
63 wxString GetCommitMessage();
64 void SetPreviousCommitMessage(const wxString& previous) { m_previousCommitMessage = previous; }
65 void SetHistory(const wxString& history) { m_history = wxStringTokenize(history, "\n"); }
66 bool IsAmending() const { return m_checkBoxAmend->IsChecked(); }
67
68 private:
69 void OnChangeFile(wxDataViewEvent& e);
70
71 protected:
72 virtual void OnAmendClicked(wxCommandEvent& event);
73 virtual void OnCommitHistory(wxCommandEvent& event);
74 virtual void OnCommitHistoryUI(wxUpdateUIEvent& event);
75 virtual void OnToggleCheckAll(wxCommandEvent& event);
76 virtual void OnCommitOK(wxCommandEvent& event);
77 };
78
79 #endif