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,
48 wxLC_REPORT | wxLC_SINGLE_SEL );
62 wxVector<wxBitmapBundle> stateImages;
63 stateImages.push_back( wxBitmapBundle() );
75 wxImageList* imageList =
new wxImageList(
88 m_listCtrl->SetImageList( imageList, wxIMAGE_LIST_SMALL );
92 for(
auto& [filename, status] : filesToCommit )
97 if( status & ( GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_NEW ) )
103 if( status & ( GIT_STATUS_INDEX_NEW ) )
106 else if( status & ( GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED ) )
112 if( status & ( GIT_STATUS_INDEX_MODIFIED ) )
115 else if( status & ( GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_DELETED ) )
121 if( status & ( GIT_STATUS_INDEX_DELETED ) )
126 printf(
" Unknown status: %d\n", status );
130 sizer->Add(
m_listCtrl, 1, wxEXPAND | wxALL, 5 );
133 wxStaticText* commitMessageLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Commit Message:" ) );
135 new wxTextCtrl(
this, wxID_ANY,
"", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
136 sizer->Add( commitMessageLabel, 0, wxALL, 5 );
140 wxStaticText* authorLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Author:" ) );
141 wxString defaultAuthor = defaultAuthorName +
" <" + defaultAuthorEmail +
">";
143 new wxTextCtrl(
this, wxID_ANY, defaultAuthor, wxDefaultPosition, wxDefaultSize, 0 );
144 sizer->Add( authorLabel, 0, wxALL, 5 );
149 wxStdDialogButtonSizer* buttonSizer =
new wxStdDialogButtonSizer();
151 m_okButton =
new wxButton(
this, wxID_OK,
_(
"OK" ) );
152 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL,
_(
"Cancel" ) );
153 buttonSizer->Add( cancelButton, 0, wxALL, 5 );
155 buttonSizer->Realize();
157 sizer->Add( buttonSizer, 0, wxALIGN_RIGHT | wxALL, 5 );
159 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)