20#ifndef PANEL_GIT_HISTORY_H
21#define PANEL_GIT_HISTORY_H
64 void SetBranches(
const std::vector<KIGIT_BRANCH_INFO>& aBranches );
75 void fillHistory(
const std::vector<KIGIT_COMMIT_INFO>& aCommits,
size_t aLimit );
91 void appendHistoryRows(
const std::vector<KIGIT_COMMIT_INFO>& aCommits,
size_t aFrom );
102 void applyAvatar(
const wxString& aEmail,
int aDiameter,
const std::string& aBytes );
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...
Shows what changed in one file: the old and new drawing side by side for a schematic or board,...
Read repository state without blocking the UI.
PANEL_GIT_HISTORY_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
WX_DEBOUNCED_ACTION m_historySearchDebounce
Waits for the user to pause typing in the search box before walking the history again.
PANEL_GIT_HISTORY(wxWindow *aParent, GIT_ADVANCED_DIALOG *aDialog, EDA_BASE_FRAME *aFrame)
void onHistoryScrollTick()
Grow the history window when the user has scrolled near its end.
~PANEL_GIT_HISTORY() override
bool m_fillingHistory
True while the list is being refilled, when its selection events are its own.
wxString m_detailEmail
Its author's email, so a web avatar that arrives later lands on the pane too.
wxDataViewColumn * m_historyRefsColumn
void Populate()
Load the repository's recent commits in the background, up to the current window.
wxTimer m_historyScrollTimer
Polls whether the user scrolled near the end of the history, which is the one portable way to notice ...
void requestAvatar(const wxString &aEmail, int aDiameter)
Start a background fetch of the contributor's web avatar for aEmail, if opted in and not already cach...
std::atomic< bool > m_avatarCancel
Set when the page goes, so a fetch still waiting on the network gives up rather than holding the clos...
size_t m_historyLimit
How many commits the page currently shows at most. Grows as the user scrolls.
bool m_historyComplete
True once a load returned fewer commits than asked for, meaning everything is shown.
KIGIT_QUERY m_historyQuery
Listing and selection have separate requests so choosing a commit does not cancel paging.
int m_historySashPos
Where the user left the sash, so the pane comes back at the same width.
std::set< wxString > m_avatarRequested
Emails whose avatar fetch was already started, so each is fetched at most once.
KIGIT_QUERY m_actionQuery
Read action preconditions without delaying history selection or scrolling.
void showFileDiff(const wxString &aPath)
Show what the selected commit did to aPath under the file list, or hide that area.
std::vector< wxString > m_historyEmails
Author email for each history row, so a fetched avatar can find its rows.
void SetBranches(const std::vector< KIGIT_BRANCH_INFO > &aBranches)
Offer every branch in the branch filter, keeping the current choice.
std::vector< std::thread > m_avatarWorkers
The avatar fetches this page started, joined before it goes.
void showCommitDetail(const wxString &aHash)
Fill the detail pane with aHash, or clear it when the hash is empty or gone.
void ShowHistoryForFile(const wxString &aPath)
Narrow the list to the commits that changed aPath, a file or folder relative to the repository root.
GIT_ADVANCED_DIALOG * m_dialog
KIGIT_QUERY m_detailQuery
void onRestoreVersion(const wxString &aCommitHash)
Restore the project as it was at the given commit, recorded as a new commit on top of the current hea...
void applyAvatar(const wxString &aEmail, int aDiameter, const std::string &aBytes)
On the UI thread, decode the fetched avatar bytes and place the photo on every history row for aEmail...
GIT_FILE_DIFF_AREA * m_fileDiff
std::vector< bool > m_historyAtHead
Whether each row's commit is the one HEAD points at.
void restoreVersion(const wxString &aCommitHash, const KIGIT::GIT_IDENTITY &aIdentity)
void fillCommitDetail(const KIGIT_COMMIT_DETAIL &aDetail)
wxString m_detailParent
The first parent of the shown commit, which the diff area's before side names.
void fillHistory(const std::vector< KIGIT_COMMIT_INFO > &aCommits, size_t aLimit)
Apply a loaded history window, keeping the currently selected commit when possible.
void appendHistoryRows(const std::vector< KIGIT_COMMIT_INFO > &aCommits, size_t aFrom)
Append rows for aCommits starting at aFrom, without clearing, so growing the history window keeps the...
std::map< wxString, wxBitmap > m_avatarCache
Fetched web avatars, keyed by author email.
void reloadHistory()
Restart the history at the first window after the search or branch filter changed.
KIGIT_HISTORY_FILTER historyFilter() const
The search text and branch the page is narrowed to.
wxString m_historyPath
The file or folder the history is narrowed to, or empty for all of it.
wxString m_historyBranchName
The branch the list is narrowed to, or empty for every branch.
int m_detailSashPos
Where the user left the sash between the file list and the diff area.
wxString m_detailHash
The commit the detail pane shows, so a refresh can put the selection back on it.
Debounces an action: runs it only after a quiet period following the last trigger.
Repository values and whether Git can use them to record a commit.