38 const wxString& defaultAuthorName,
39 const wxString& defaultAuthorEmail,
40 const std::map<wxString, int>& filesToCommit ) :
43 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
47 m_listCtrl =
new wxListCtrl(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
61 wxVector<wxBitmapBundle> stateImages;
62 stateImages.push_back( wxBitmapBundle() );
74 wxImageList* imageList =
new wxImageList(
87 m_listCtrl->SetImageList( imageList, wxIMAGE_LIST_SMALL );
91 for(
auto& [filename, status] : filesToCommit )
96 if( status & ( GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_NEW ) )
102 if( status & ( GIT_STATUS_INDEX_NEW ) )
105 else if( status & ( GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED ) )
111 if( status & ( GIT_STATUS_INDEX_MODIFIED ) )
114 else if( status & ( GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_DELETED ) )
120 if( status & ( GIT_STATUS_INDEX_DELETED ) )
125 printf(
" Unknown status: %d\n", status );
129 sizer->Add(
m_listCtrl, 1, wxEXPAND | wxALL, 5 );
132 wxStaticText* commitMessageLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Commit Message:" ) );
134 new wxTextCtrl(
this, wxID_ANY,
"", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
135 sizer->Add( commitMessageLabel, 0, wxALL, 5 );
139 wxStaticText* authorLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Author:" ) );
140 wxString defaultAuthor = defaultAuthorName +
" <" + defaultAuthorEmail +
">";
142 new wxTextCtrl(
this, wxID_ANY, defaultAuthor, wxDefaultPosition, wxDefaultSize, 0 );
143 sizer->Add( authorLabel, 0, wxALL, 5 );
148 wxStdDialogButtonSizer* buttonSizer =
new wxStdDialogButtonSizer();
150 m_okButton =
new wxButton(
this, wxID_OK,
_(
"OK" ) );
151 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL,
_(
"Cancel" ) );
152 buttonSizer->Add( cancelButton, 0, wxALL, 5 );
154 buttonSizer->Realize();
156 sizer->Add( buttonSizer, 0, wxALIGN_RIGHT | wxALL, 5 );
158 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)