38 m_tagsList->AppendColumn(
_(
"Tag" ), wxLIST_FORMAT_LEFT, FromDIP( 220 ) );
39 m_tagsList->AppendColumn(
_(
"Commit" ), wxLIST_FORMAT_LEFT, FromDIP( 100 ) );
40 m_tagsList->AppendColumn(
_(
"Date" ), wxLIST_FORMAT_LEFT, FromDIP( 110 ) );
49 [
this]( wxListEvent& aEvent )
56 [
this]( wxListEvent& )
59 &&
m_tagsList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ) == -1 )
66 [
this]( wxCommandEvent& )
71 [
this]( wxCommandEvent& )
76 [
this]( wxCommandEvent& )
85 if( !
m_dialog->SessionStillCurrent() )
90 auto tags = std::make_shared<std::vector<KIGIT_TAG_INFO>>();
96 *tags = aCommon.GetTags();
100 if( !m_dialog->SessionStillCurrent() )
103 wxString selected = KIGIT::SelectedText( m_tagsList, 0 );
104 long selectRow = wxNOT_FOUND;
106 m_detailQuery.Cancel();
107 m_fillingTags = true;
108 m_tagsList->DeleteAllItems();
110 for( const KIGIT_TAG_INFO& t : *tags )
112 long idx = m_tagsList->InsertItem( m_tagsList->GetItemCount(), t.name );
113 m_tagsList->SetItem( idx, 1, t.hash );
114 m_tagsList->SetItem( idx, 2, KIGIT::RelativeDate( t.when ) );
116 if( t.name == selected || ( selected.IsEmpty() && idx == 0 ) )
121 m_tagCount->SetLabel( shown == 1 ?
_(
"1 tag" ) : wxString::Format(
_(
"%d tags" ), shown ) );
123 if( selectRow != wxNOT_FOUND )
125 m_tagsList->SetItemState( selectRow, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
142 if( aTag.IsEmpty() || !
m_dialog->SessionStillCurrent() )
145 auto detail = std::make_shared<KIGIT_TAG_DETAIL>();
151 *detail = aCommon.GetTagDetail( aTag );
155 if( m_dialog->SessionStillCurrent() && KIGIT::SelectedText( m_tagsList, 0 ) == aTag )
157 fillTagDetail( *detail );
171 m_tagTitle->SetLabel( wxString::Format(
_(
"Tag: %s" ), aDetail.
name ) );
172 m_tagCommit->SetLabel( wxString::Format(
_(
"Commit: %s" ), aDetail.
hash ) );
193 if( !
m_dialog->SessionStillCurrent() )
209 wxString::Format(
_(
"Could not create tag '%s'." ),
name ) );
215 if( !
m_dialog->SessionStillCurrent() )
223 m_dialog->RefuseOverUncommittedWork(
226 if( !
IsOK(
this, wxString::Format(
_(
"Check out tag '%s'? This shows an old snapshot of the "
227 "project. To keep any commits you make here, create a new "
228 "branch before committing. Switching away without one "
229 "leaves those commits outside every branch." ),
235 if( !
m_dialog->ConfirmWorkingTreeChange( aStatus ) )
243 wxString::Format(
_(
"Could not check out tag '%s'." ),
name ),
251 if( !
m_dialog->SessionStillCurrent() )
259 if( !
IsOK(
this, wxString::Format(
_(
"Delete tag '%s'?" ),
name ) ) )
267 wxString::Format(
_(
"Could not delete tag '%s'." ),
name ) );
Ask for a tag's name and its optional message. A message makes the tag annotated.
wxString GetMessage() const
The base frame for deriving all KiCad main window classes.
The advanced Git window: a non-modal dialog with a top bar naming the repository and branch and a sid...
The project's git session.
bool CheckoutTag(const wxString &aName)
bool DeleteTag(const wxString &aName)
bool CreateTag(const wxString &aName, const wxString &aMessage=wxEmptyString)
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
This file is part of the common library.
Base window classes and related definitions.
void UnsplitKeepingSash(wxSplitterWindow *aSplitter, wxWindow *aPane, int &aSashPos)
Close a splitter's second pane, keeping the sash where the user left it for next time.
wxString SelectedText(wxListCtrl *aList, int aColumn)
The text of the selected row in a report list, or empty when nothing is selected.
wxString RelativeDate(const wxDateTime &aWhen)
"just now", "3 hours ago", or the ISO date once it is more than a month old.
void MarkDestructive(wxButton *aButton)
Paint a button's text the diff's red, for one that throws something away.
Repository state used before an operation that requires a clean working tree.
wxString message
The tag's own message, or the commit's for a lightweight tag.
wxString email
Their email.
wxString name
The tag name.
wxString hash
Short hash of the tagged commit.
wxDateTime when
When the tag was made, or the commit for a lightweight tag.
wxString author
Who made the tag, or the commit for a lightweight tag.
bool found
False when no tag of that name points at a commit.