34 const wxString& defaultAuthorName,
35 const wxString& defaultAuthorEmail,
36 const std::map<wxString, int>& filesToCommit ) :
39 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
43 m_listCtrl =
new wxListCtrl(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
57 wxVector<wxBitmapBundle> stateImages;
58 stateImages.push_back( wxBitmapBundle() );
70 wxImageList* imageList =
new wxImageList(
83 m_listCtrl->SetImageList( imageList, wxIMAGE_LIST_SMALL );
87 for(
auto& [filename, status] : filesToCommit )
92 if( status & ( GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_NEW ) )
98 if( status & ( GIT_STATUS_INDEX_NEW ) )
101 else if( status & ( GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED ) )
107 if( status & ( GIT_STATUS_INDEX_MODIFIED ) )
110 else if( status & ( GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_DELETED ) )
116 if( status & ( GIT_STATUS_INDEX_DELETED ) )
121 printf(
" Unknown status: %d\n", status );
125 sizer->Add(
m_listCtrl, 1, wxEXPAND | wxALL, 5 );
128 wxStaticText* commitMessageLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Commit Message:" ) );
130 new wxTextCtrl(
this, wxID_ANY,
"", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
134 sizer->Add( commitMessageLabel, 0, wxALL, 5 );
138 wxStaticText* authorLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Author:" ) );
139 wxString defaultAuthor = defaultAuthorName +
" <" + defaultAuthorEmail +
">";
141 new wxTextCtrl(
this, wxID_ANY, defaultAuthor, wxDefaultPosition, wxDefaultSize, 0 );
142 sizer->Add( authorLabel, 0, wxALL, 5 );
147 wxStdDialogButtonSizer* buttonSizer =
new wxStdDialogButtonSizer();
149 m_okButton =
new wxButton(
this, wxID_OK,
_(
"OK" ) );
150 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL,
_(
"Cancel" ) );
151 buttonSizer->Add( cancelButton, 0, wxALL, 5 );
153 buttonSizer->Realize();
155 sizer->Add( buttonSizer, 0, wxALIGN_RIGHT | wxALL, 5 );
157 SetSizerAndFit( sizer );
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)