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

The advanced git window's Stashes page: the list beside the selected stash's detail, with the actions that save, apply, pop and drop a stash. More...

#include <panel_git_stashes.h>

Inheritance diagram for PANEL_GIT_STASHES:
PANEL_GIT_STASHES_BASE

Public Member Functions

 PANEL_GIT_STASHES (wxWindow *aParent, GIT_ADVANCED_DIALOG *aDialog, EDA_BASE_FRAME *aFrame)
 
void Populate ()
 Fill the list from the repository's stashes. The repository is read on a worker.
 

Protected Attributes

wxSplitterWindow * m_stashesSplitter
 
wxPanel * m_stashListPanel
 
wxListCtrl * m_stashesList
 
wxStaticText * m_stashCount
 
wxPanel * m_stashDetail
 
wxStaticText * m_stashWhen
 
wxStaticText * m_stashBranch
 
wxStaticText * m_stashCommit
 
wxTextCtrl * m_stashMessage
 
wxListCtrl * m_stashFiles
 
wxButton * m_applyStashButton
 
wxButton * m_popStashButton
 
wxButton * m_dropStashButton
 
wxButton * m_stashSaveButton
 

Private Member Functions

void showStashDetail (const wxString &aId)
 Fill the detail pane with the stash aId names, or hide it when the id is empty or gone.
 
void fillStashDetail (const KIGIT_STASH_DETAIL &aDetail)
 
void hideStashDetail ()
 
wxString stashIdForRow (long aRow) const
 The stash shown on aRow, by its commit, or empty when the row is gone.
 
void restoreSelectedStash (bool aRemoveAfterApply)
 
void onStashApply ()
 
void onStashPop ()
 
void onStashDrop ()
 
void onStashSave ()
 
void checkStashChanges ()
 After saving the editors, read the changes before asking for a stash description.
 

Private Attributes

GIT_ADVANCED_DIALOG * m_dialog
 
EDA_BASE_FRAME * m_frame
 
std::vector< wxString > m_stashIds
 The stash commit behind each row, since a row's index is only valid for the listing it came from.
 
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_stashSashPos = 0
 Where the user left the sash between the list and its detail pane.
 
bool m_fillingStashes = false
 True while the list is being refilled, when its selection events are its own.
 

Detailed Description

The advanced git window's Stashes page: the list beside the selected stash's detail, with the actions that save, apply, pop and drop a stash.

Definition at line 37 of file panel_git_stashes.h.

Constructor & Destructor Documentation

◆ PANEL_GIT_STASHES()

Member Function Documentation

◆ checkStashChanges()

void PANEL_GIT_STASHES::checkStashChanges ( )
private

After saving the editors, read the changes before asking for a stash description.

Definition at line 395 of file panel_git_stashes.cpp.

References _, KIPLATFORM::UI::IsDarkTheme(), m_actionQuery, m_dialog, m_frame, message, and ProjectSafeToRewrite().

Referenced by onStashSave().

◆ fillStashDetail()

◆ hideStashDetail()

◆ onStashApply()

void PANEL_GIT_STASHES::onStashApply ( )
private

Definition at line 307 of file panel_git_stashes.cpp.

References restoreSelectedStash().

Referenced by PANEL_GIT_STASHES().

◆ onStashDrop()

void PANEL_GIT_STASHES::onStashDrop ( )
private

◆ onStashPop()

void PANEL_GIT_STASHES::onStashPop ( )
private

Definition at line 313 of file panel_git_stashes.cpp.

References restoreSelectedStash().

Referenced by PANEL_GIT_STASHES().

◆ onStashSave()

◆ Populate()

void PANEL_GIT_STASHES::Populate ( )

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

Definition at line 134 of file panel_git_stashes.cpp.

References _, hideStashDetail(), m_detailQuery, m_dialog, m_fillingStashes, m_frame, m_listQuery, PANEL_GIT_STASHES_BASE::m_stashCount, PANEL_GIT_STASHES_BASE::m_stashesList, showStashDetail(), and stashIdForRow().

◆ restoreSelectedStash()

void PANEL_GIT_STASHES::restoreSelectedStash ( bool aRemoveAfterApply)
private

◆ showStashDetail()

void PANEL_GIT_STASHES::showStashDetail ( const wxString & aId)
private

Fill the detail pane with the stash aId names, or hide it when the id is empty or gone.

Definition at line 193 of file panel_git_stashes.cpp.

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

Referenced by PANEL_GIT_STASHES(), and Populate().

◆ stashIdForRow()

wxString PANEL_GIT_STASHES::stashIdForRow ( long aRow) const
private

The stash shown on aRow, by its commit, or empty when the row is gone.

Definition at line 254 of file panel_git_stashes.cpp.

References m_stashIds.

Referenced by onStashDrop(), PANEL_GIT_STASHES(), Populate(), and restoreSelectedStash().

Member Data Documentation

◆ m_actionQuery

KIGIT_QUERY PANEL_GIT_STASHES::m_actionQuery
private

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

Definition at line 75 of file panel_git_stashes.h.

Referenced by checkStashChanges(), and onStashSave().

◆ m_applyStashButton

wxButton* PANEL_GIT_STASHES_BASE::m_applyStashButton
protectedinherited

◆ m_detailQuery

KIGIT_QUERY PANEL_GIT_STASHES::m_detailQuery
private

Definition at line 72 of file panel_git_stashes.h.

Referenced by hideStashDetail(), Populate(), and showStashDetail().

◆ m_dialog

◆ m_dropStashButton

wxButton* PANEL_GIT_STASHES_BASE::m_dropStashButton
protectedinherited

◆ m_fillingStashes

bool PANEL_GIT_STASHES::m_fillingStashes = false
private

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

Definition at line 81 of file panel_git_stashes.h.

Referenced by PANEL_GIT_STASHES(), and Populate().

◆ m_frame

EDA_BASE_FRAME* PANEL_GIT_STASHES::m_frame
private

◆ m_listQuery

KIGIT_QUERY PANEL_GIT_STASHES::m_listQuery
private

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

Definition at line 71 of file panel_git_stashes.h.

Referenced by Populate().

◆ m_popStashButton

wxButton* PANEL_GIT_STASHES_BASE::m_popStashButton
protectedinherited

◆ m_stashBranch

wxStaticText* PANEL_GIT_STASHES_BASE::m_stashBranch
protectedinherited

◆ m_stashCommit

wxStaticText* PANEL_GIT_STASHES_BASE::m_stashCommit
protectedinherited

◆ m_stashCount

wxStaticText* PANEL_GIT_STASHES_BASE::m_stashCount
protectedinherited

Definition at line 42 of file panel_git_stashes_base.h.

Referenced by PANEL_GIT_STASHES_BASE(), and PANEL_GIT_STASHES::Populate().

◆ m_stashDetail

wxPanel* PANEL_GIT_STASHES_BASE::m_stashDetail
protectedinherited

◆ m_stashesList

wxListCtrl* PANEL_GIT_STASHES_BASE::m_stashesList
protectedinherited

◆ m_stashesSplitter

wxSplitterWindow* PANEL_GIT_STASHES_BASE::m_stashesSplitter
protectedinherited

◆ m_stashFiles

wxListCtrl* PANEL_GIT_STASHES_BASE::m_stashFiles
protectedinherited

◆ m_stashIds

std::vector<wxString> PANEL_GIT_STASHES::m_stashIds
private

The stash commit behind each row, since a row's index is only valid for the listing it came from.

Definition at line 68 of file panel_git_stashes.h.

Referenced by stashIdForRow().

◆ m_stashListPanel

wxPanel* PANEL_GIT_STASHES_BASE::m_stashListPanel
protectedinherited

◆ m_stashMessage

wxTextCtrl* PANEL_GIT_STASHES_BASE::m_stashMessage
protectedinherited

◆ m_stashSashPos

int PANEL_GIT_STASHES::m_stashSashPos = 0
private

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

Definition at line 78 of file panel_git_stashes.h.

Referenced by fillStashDetail(), hideStashDetail(), and PANEL_GIT_STASHES().

◆ m_stashSaveButton

wxButton* PANEL_GIT_STASHES_BASE::m_stashSaveButton
protectedinherited

◆ m_stashWhen

wxStaticText* PANEL_GIT_STASHES_BASE::m_stashWhen
protectedinherited

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