KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PANEL_GIT_BRANCHES Class Reference

The advanced git window's Branches page: a searchable list beside the selected branch's detail, with the actions that create, delete and force push a branch. More...

#include <panel_git_branches.h>

Inheritance diagram for PANEL_GIT_BRANCHES:
PANEL_GIT_BRANCHES_BASE

Public Member Functions

 PANEL_GIT_BRANCHES (wxWindow *aParent, GIT_ADVANCED_DIALOG *aDialog, EDA_BASE_FRAME *aFrame)
 
 ~PANEL_GIT_BRANCHES () override
 
void Populate ()
 Fill the list from the repository's branches. The repository is read on a worker.
 
void StopTransfer ()
 Ask a force push still running to stop. It finishes on its own.
 

Protected Attributes

wxSearchCtrl * m_branchSearch
 
wxSplitterWindow * m_branchesSplitter
 
wxPanel * m_branchListPanel
 
wxListCtrl * m_branchesList
 
wxStaticText * m_branchCount
 
wxPanel * m_branchDetail
 
wxStaticText * m_branchTitle
 
wxStaticText * m_branchCommit
 
wxStaticText * m_branchAuthor
 
wxTextCtrl * m_branchMessage
 
wxStaticText * m_branchSync
 
wxButton * m_newBranchButton
 
wxButton * m_deleteBranchButton
 
wxButton * m_forcePushButton
 

Private Member Functions

void reloadBranches ()
 Refill the list after the search text changed.
 
void showBranchDetail (const wxString &aBranch)
 Fill the detail pane with aBranch, or hide it when the name is empty or gone.
 
void fillBranchDetail (const KIGIT_BRANCH_DETAIL &aDetail)
 
void hideBranchDetail ()
 
void onNewBranch ()
 
void onDeleteBranch ()
 
void onForcePush ()
 Force push the current branch, after an explicit confirmation.
 
void startForcePush (std::shared_ptr< KIGIT_COMMON > aCommon, const wxString &aExpectedBranch, const wxString &aExpectedHeadOid)
 

Private Attributes

GIT_ADVANCED_DIALOG * m_dialog
 
EDA_BASE_FRAME * m_frame
 
std::vector< bool > m_branchIsRemote
 Whether each listed row is a remote-tracking branch.
 
KIGIT_TRANSFER m_push
 The force push this page started.
 
KIGIT_QUERY m_listQuery
 List and detail reads share the session lock without waiting on the UI thread.
 
KIGIT_QUERY m_detailQuery
 
KIGIT_QUERY m_actionQuery
 Reads needed before an action's confirmation, separate from list refreshes.
 
int m_branchSashPos = 0
 Where the user left the sash between the list and its detail pane.
 
bool m_fillingBranches = false
 True while the list is being refilled, when its selection events are its own.
 

Detailed Description

The advanced git window's Branches page: a searchable list beside the selected branch's detail, with the actions that create, delete and force push a branch.

Definition at line 37 of file panel_git_branches.h.

Constructor & Destructor Documentation

◆ PANEL_GIT_BRANCHES()

◆ ~PANEL_GIT_BRANCHES()

PANEL_GIT_BRANCHES::~PANEL_GIT_BRANCHES ( )
override

Definition at line 119 of file panel_git_branches.cpp.

References StopTransfer().

Member Function Documentation

◆ fillBranchDetail()

◆ hideBranchDetail()

◆ onDeleteBranch()

void PANEL_GIT_BRANCHES::onDeleteBranch ( )
private

◆ onForcePush()

◆ onNewBranch()

◆ Populate()

void PANEL_GIT_BRANCHES::Populate ( )

Fill the list from the repository's branches. The repository is read on a worker.

Definition at line 131 of file panel_git_branches.cpp.

References _, hideBranchDetail(), PANEL_GIT_BRANCHES_BASE::m_branchCount, PANEL_GIT_BRANCHES_BASE::m_branchesList, m_detailQuery, m_dialog, m_fillingBranches, m_frame, m_listQuery, and showBranchDetail().

Referenced by reloadBranches().

◆ reloadBranches()

void PANEL_GIT_BRANCHES::reloadBranches ( )
private

Refill the list after the search text changed.

Definition at line 201 of file panel_git_branches.cpp.

References Populate().

Referenced by PANEL_GIT_BRANCHES().

◆ showBranchDetail()

void PANEL_GIT_BRANCHES::showBranchDetail ( const wxString & aBranch)
private

Fill the detail pane with aBranch, or hide it when the name is empty or gone.

Definition at line 207 of file panel_git_branches.cpp.

References hideBranchDetail(), m_detailQuery, m_dialog, and m_frame.

Referenced by PANEL_GIT_BRANCHES(), and Populate().

◆ startForcePush()

void PANEL_GIT_BRANCHES::startForcePush ( std::shared_ptr< KIGIT_COMMON > aCommon,
const wxString & aExpectedBranch,
const wxString & aExpectedHeadOid )
private

Definition at line 475 of file panel_git_branches.cpp.

References _, KIGIT::CallOnUi(), Error, m_dialog, m_push, result, and Success.

Referenced by onForcePush().

◆ StopTransfer()

void PANEL_GIT_BRANCHES::StopTransfer ( )

Ask a force push still running to stop. It finishes on its own.

Definition at line 125 of file panel_git_branches.cpp.

References m_push.

Referenced by ~PANEL_GIT_BRANCHES().

Member Data Documentation

◆ m_actionQuery

KIGIT_QUERY PANEL_GIT_BRANCHES::m_actionQuery
private

Reads needed before an action's confirmation, separate from list refreshes.

Definition at line 81 of file panel_git_branches.h.

Referenced by onDeleteBranch(), and onForcePush().

◆ m_branchAuthor

wxStaticText* PANEL_GIT_BRANCHES_BASE::m_branchAuthor
protectedinherited

◆ m_branchCommit

wxStaticText* PANEL_GIT_BRANCHES_BASE::m_branchCommit
protectedinherited

◆ m_branchCount

wxStaticText* PANEL_GIT_BRANCHES_BASE::m_branchCount
protectedinherited

◆ m_branchDetail

wxPanel* PANEL_GIT_BRANCHES_BASE::m_branchDetail
protectedinherited

◆ m_branchesList

wxListCtrl* PANEL_GIT_BRANCHES_BASE::m_branchesList
protectedinherited

◆ m_branchesSplitter

wxSplitterWindow* PANEL_GIT_BRANCHES_BASE::m_branchesSplitter
protectedinherited

◆ m_branchIsRemote

std::vector<bool> PANEL_GIT_BRANCHES::m_branchIsRemote
private

Whether each listed row is a remote-tracking branch.

Those are shown but cannot be switched to, so the row has to say which it is.

Definition at line 71 of file panel_git_branches.h.

Referenced by PANEL_GIT_BRANCHES().

◆ m_branchListPanel

wxPanel* PANEL_GIT_BRANCHES_BASE::m_branchListPanel
protectedinherited

◆ m_branchMessage

wxTextCtrl* PANEL_GIT_BRANCHES_BASE::m_branchMessage
protectedinherited

◆ m_branchSashPos

int PANEL_GIT_BRANCHES::m_branchSashPos = 0
private

Where the user left the sash between the list and its detail pane.

Definition at line 84 of file panel_git_branches.h.

Referenced by fillBranchDetail(), hideBranchDetail(), and PANEL_GIT_BRANCHES().

◆ m_branchSearch

wxSearchCtrl* PANEL_GIT_BRANCHES_BASE::m_branchSearch
protectedinherited

◆ m_branchSync

wxStaticText* PANEL_GIT_BRANCHES_BASE::m_branchSync
protectedinherited

◆ m_branchTitle

wxStaticText* PANEL_GIT_BRANCHES_BASE::m_branchTitle
protectedinherited

◆ m_deleteBranchButton

wxButton* PANEL_GIT_BRANCHES_BASE::m_deleteBranchButton
protectedinherited

◆ m_detailQuery

KIGIT_QUERY PANEL_GIT_BRANCHES::m_detailQuery
private

Definition at line 78 of file panel_git_branches.h.

Referenced by hideBranchDetail(), Populate(), and showBranchDetail().

◆ m_dialog

GIT_ADVANCED_DIALOG* PANEL_GIT_BRANCHES::m_dialog
private

◆ m_fillingBranches

bool PANEL_GIT_BRANCHES::m_fillingBranches = false
private

True while the list is being refilled, when its selection events are its own.

Definition at line 87 of file panel_git_branches.h.

Referenced by PANEL_GIT_BRANCHES(), and Populate().

◆ m_forcePushButton

wxButton* PANEL_GIT_BRANCHES_BASE::m_forcePushButton
protectedinherited

◆ m_frame

EDA_BASE_FRAME* PANEL_GIT_BRANCHES::m_frame
private

◆ m_listQuery

KIGIT_QUERY PANEL_GIT_BRANCHES::m_listQuery
private

List and detail reads share the session lock without waiting on the UI thread.

Definition at line 77 of file panel_git_branches.h.

Referenced by Populate().

◆ m_newBranchButton

wxButton* PANEL_GIT_BRANCHES_BASE::m_newBranchButton
protectedinherited

◆ m_push

KIGIT_TRANSFER PANEL_GIT_BRANCHES::m_push
private

The force push this page started.

Definition at line 74 of file panel_git_branches.h.

Referenced by onForcePush(), startForcePush(), and StopTransfer().


The documentation for this class was generated from the following files: