20#ifndef GIT_ADVANCED_DIALOG_H
21#define GIT_ADVANCED_DIALOG_H
28#include <wx/weakref.h>
46class wxSplitterWindow;
80 std::optional<GIT_ADVANCED_PAGE> aPage = std::nullopt );
93 void ShowAmend(
const wxString& aCommitHash );
111 bool aRewritesWorkingTree =
false );
116 bool aRewritesWorkingTree =
false );
158 void onFetch(
bool aRetriedAfterTrust =
false );
159 void startFetch( std::shared_ptr<KIGIT_COMMON> aCommon,
bool aRetriedAfterTrust );
165 void endFetch(
const wxString& aStatus );
DIALOG_GIT_ADVANCED_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Advanced Git"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
The base frame for deriving all KiCad main window classes.
EDA_BASE_FRAME * m_parent
bool abandonFetchPreflight()
Stop a pending remote check and release what the fetch holds. False when none is pending.
GIT_ADVANCED_DIALOG(EDA_BASE_FRAME *aParent, GIT_COMMIT_PANE *aPane)
int m_credentialPrompts
Keyring reads and credential prompts the current fetch has shown, reset when it ends.
static void ShowHistoryForFile(EDA_BASE_FRAME *aParent, GIT_COMMIT_PANE *aPane, const wxString &aPath)
Open the window on its History page, narrowed to the commits that changed aPath.
PANEL_GIT_BRANCHES * m_branchesPage
void RefuseOverUncommittedWork(std::function< void(const GIT_WORKTREE_STATUS &)> aReady)
Check the working tree and LFS on a worker, then continue on the UI thread only when nothing is uncom...
void ShowTransferProgress(const wxString &aText)
Show a line of transfer progress on the hosted commit panel's status line.
void showWorkingDiff(const wxString &aPath)
Show the working copy of aPath against its committed version, or hide that area.
GIT_FILE_DIFF_AREA * m_workingDiff
void SwitchToBranch(const wxString &aBranch)
Switch the working tree to the named branch, after confirming, then refresh.
static void CloseForPane(GIT_COMMIT_PANE *aPane)
Close the live window if the given pane opened it, for when that pane goes away.
PANEL_GIT_REPOSITORY * m_repositoryPage
PANEL_GIT_HISTORY * m_historyPage
PANEL_GIT_REMOTES * m_remotesPage
EDITOR_SNAPSHOT m_docsBeforeChange
On-disk identity of the open documents, taken by ConfirmWorkingTreeChange() so only the documents an ...
void selectPage(GIT_ADVANCED_PAGE aPage)
bool ConfirmWorkingTreeChange()
After the asynchronous LFS check, save the open editors and snapshot their documents before an action...
static void CloseActive()
Close the live window, for when the project it was filled from goes away.
wxSplitterWindow * m_changesSplitter
void endFetch(const wxString &aStatus)
Restore the Fetch button and release the fetch's hold, then show aStatus on the commit panel.
KIGIT_QUERY m_reloadQuery
Reads the top bar and history branch choices without holding up the UI.
std::weak_ptr< KIGIT_COMMON > m_listenerSession
static GIT_ADVANCED_DIALOG * Active()
The live window, or null when none is open.
void RunGitAction(const std::function< bool(KIGIT_COMMON &)> &aFn, const wxString &aError, bool aRewritesWorkingTree=false)
Run a repository write under the action lock, then refresh every surface on success.
PANEL_GIT_STASHES * m_stashesPage
void syncListener()
Attach once to the project's session.
bool m_fetchPreflight
The fetch is checking its remote, before its transfer starts, and holds the panes busy.
KIGIT_QUERY m_actionQuery
Preflight reads for actions that may replace the working tree.
bool SessionStillCurrent()
True while the frame's git session is still the one this window's lists were filled from.
GIT_TRANSFER_BUSY::HOLD m_fetchBusy
The top bar fetch's hold on its repository, from its remote check until it ends.
static void ShowForFrame(EDA_BASE_FRAME *aParent, GIT_COMMIT_PANE *aPane, std::optional< GIT_ADVANCED_PAGE > aPage=std::nullopt)
Raise the one window for this session, creating it on first use.
unsigned m_fetchRequest
Counts the fetches begun, so a keyring read finishing late starts only its own.
~GIT_ADVANCED_DIALOG() override
wxWindow * buildChangesPage(wxWindow *aBook)
The Changes page: the docked panel's commit controls with the selected file's diff below.
GIT_COMMIT_PANE * m_changesPane
int m_changesSashPos
Where the user left the sash between the Changes page's list and its diff area.
wxWeakRef< GIT_COMMIT_PANE > m_pane
Weak because the pane can be destroyed before this dialog's deferred delete runs.
void optOutOfTextPersistence(wxWindow *aWindow)
Keep every text box in aWindow out of the dialog's saved control state.
void setIcons()
The page and toolbar icons, again after a light or dark switch.
void RunGitAction(const std::function< bool(KIGIT_COMMON &, wxString &aDetail)> &aFn, const wxString &aError, bool aRewritesWorkingTree=false)
As above, for an action with a message of its own: what it writes to aDetail is shown in place of lib...
void onFetch(bool aRetriedAfterTrust=false)
Fetch from the remote on a worker, then refresh every surface.
void startFetch(std::shared_ptr< KIGIT_COMMON > aCommon, bool aRetriedAfterTrust)
void ShowAmend(const wxString &aCommitHash)
Open the Changes page to amend the selected history commit.
KIGIT_TRANSFER m_fetch
The fetch the top bar started.
PANEL_GIT_TAGS * m_tagsPage
void populateTopBar()
Fill the top bar's repository name and branch list.
Docked panel for committing: the branch to commit to, a summary and description, the commit options,...
Shows what changed in one file: the old and new drawing side by side for a schematic or board,...
One transfer's hold on its repository, released when reset, begun again or destroyed.
The project's git session.
Read repository state without blocking the UI.
The advanced git window's Branches page: a searchable list beside the selected branch's detail,...
The advanced git window's History page: filters above a list of commits beside the selected commit's ...
The advanced git window's Remotes page: the list beside the selected remote's detail,...
Show the repository's author and open the shared identity editor.
The advanced git window's Stashes page: the list beside the selected stash's detail,...
GIT_ADVANCED_PAGE
The advanced window's pages, in the order its sidebar lists them.
What the open editors and the project settings looked like on disk before an operation that may rewri...
Repository state used before an operation that requires a clean working tree.