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 ) );
51 [
this]( wxListEvent& aEvent )
58 [
this]( wxListEvent& )
61 &&
m_tagsList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ) == -1 )
68 [
this]( wxCommandEvent& )
73 [
this]( wxCommandEvent& )
78 [
this]( wxCommandEvent& )
87 if( !
m_dialog->SessionStillCurrent() )
92 auto tags = std::make_shared<std::vector<KIGIT_TAG_INFO>>();
98 *tags = aCommon.GetTags();
102 if( !m_dialog->SessionStillCurrent() )
105 wxString selected = KIGIT::SelectedText( m_tagsList, 0 );
106 long selectRow = wxNOT_FOUND;
108 m_detailQuery.Cancel();
109 m_fillingTags = true;
110 m_tagsList->DeleteAllItems();
112 for( const KIGIT_TAG_INFO& t : *tags )
114 long idx = m_tagsList->InsertItem( m_tagsList->GetItemCount(), t.name );
115 m_tagsList->SetItem( idx, 1, t.hash );
116 m_tagsList->SetItem( idx, 2, KIGIT::RelativeDate( t.when ) );
118 if( t.name == selected || ( selected.IsEmpty() && idx == 0 ) )
123 m_tagCount->SetLabel( wxString::Format( wxPLURAL(
"%d tag",
"%d tags", shown ), shown ) );
125 if( selectRow != wxNOT_FOUND )
127 m_tagsList->SetItemState( selectRow, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
144 if( aTag.IsEmpty() || !
m_dialog->SessionStillCurrent() )
147 auto detail = std::make_shared<KIGIT_TAG_DETAIL>();
153 *detail = aCommon.GetTagDetail( aTag );
157 if( m_dialog->SessionStillCurrent() && KIGIT::SelectedText( m_tagsList, 0 ) == aTag )
159 fillTagDetail( *detail );
173 m_tagTitle->SetLabel( wxString::Format(
_(
"Tag: %s" ), aDetail.
name ) );
174 m_tagCommit->SetLabel( wxString::Format(
_(
"Commit: %s" ), aDetail.
hash ) );
195 if( !
m_dialog->SessionStillCurrent() )
211 wxString::Format(
_(
"Could not create tag '%s'." ),
name ) );
217 if( !
m_dialog->SessionStillCurrent() )
225 m_dialog->RefuseOverUncommittedWork(
228 if( !
IsOK(
this, wxString::Format(
_(
"Check out tag '%s'? This shows an old snapshot of the "
229 "project. To keep any commits you make here, create a new "
230 "branch before committing. Switching away without one "
231 "leaves those commits outside every branch." ),
237 if( !
m_dialog->ConfirmWorkingTreeChange( aStatus ) )
245 wxString::Format(
_(
"Could not check out tag '%s'." ),
name ),
253 if( !
m_dialog->SessionStillCurrent() )
261 if( !
IsOK(
this, wxString::Format(
_(
"Delete tag '%s'?" ),
name ) ) )
269 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 GetTagName() const
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 KeepDetailWidth(WX_SPLITTER_WINDOW *aSplitter)
Keep a split detail pane at the width its controls need, against both a narrow window and a dragged s...
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.