|
KiCad PCB EDA Suite
|
Window to display the tree files. More...
#include <project_tree_pane.h>
Public Member Functions | |
| PROJECT_TREE_PANE (KICAD_MANAGER_FRAME *parent) | |
| ~PROJECT_TREE_PANE () | |
| void | ReCreateTreePrj () |
| Create or modify the tree showing project file names. | |
| void | FileWatcherReset () |
| Reinit the watched paths Should be called after opening a new project to rebuild the list of watched paths. | |
| void | EmptyTreePrj () |
| Delete all m_TreeProject entries. | |
| void | WaitForGitOperations () |
| Give a running background git operation a chance to finish, asking the user to keep waiting or abandon. | |
Public Attributes | |
| KICAD_MANAGER_FRAME * | m_Parent |
| PROJECT_TREE * | m_TreeProject |
Protected Member Functions | |
| std::vector< PROJECT_TREE_ITEM * > | GetSelectedData () |
| Return the item data from item currently selected (highlighted) | |
| PROJECT_TREE_ITEM * | GetItemIdData (wxTreeItemId aId) |
| Return the item data corresponding to a wxTreeItemId identifier. | |
Static Protected Member Functions | |
| static wxString | GetFileExt (TREE_FILE_TYPE type) |
Private Member Functions | |
| void | onSelect (wxTreeEvent &Event) |
| Called on a double click on an item. | |
| void | onExpand (wxTreeEvent &Event) |
| Called on a click on the + or - button of an item with children. | |
| void | onRight (wxTreeEvent &Event) |
| Called on a right click on an item. | |
| void | showContextMenu () |
| void | onOpenSelectedFileWithTextEditor (wxCommandEvent &event) |
| Call the text editor to open the selected file in the tree project. | |
| void | onDeleteFile (wxCommandEvent &event) |
| Delete the selected file or directory in the tree project. | |
| void | onRenameFile (wxCommandEvent &event) |
| Rename the selected file or directory in the tree project. | |
| void | onOpenDirectory (wxCommandEvent &event) |
| Handles the right-click menu for opening a directory in the current system file browser. | |
| void | onCreateNewDirectory (wxCommandEvent &event) |
| Creates a new subdirectory inside the current kicad project directory the user is prompted to enter a directory name. | |
| void | onSwitchToSelectedProject (wxCommandEvent &event) |
| Switch to a other project selected from the tree project (by selecting an other .pro file inside the current project folder) | |
| void | onIdle (wxIdleEvent &aEvent) |
| Idle event handler, used process the selected items at a point in time when all other events have been consumed. | |
| void | onPaint (wxPaintEvent &aEvent) |
| We don't have uniform borders so we have to draw them ourselves. | |
| void | onGitInitializeProject (wxCommandEvent &event) |
| Initialize a new git repository in the current project directory. | |
| void | onGitRemoteSettings (wxCommandEvent &event) |
| Configure (or change) the default remote on an already-initialized repository. | |
| void | onGitSwitchBranch (wxCommandEvent &event) |
| Switch to a different branch in the git repository. | |
| void | switchGitBranch (std::shared_ptr< KIGIT_COMMON > aCommon, const wxString &aBranchName, bool aCreate) |
| void | onGitRemoveVCS (wxCommandEvent &event) |
| Remove the git repository from the current project directory. | |
| void | onRunSelectedJobsFile (wxCommandEvent &event) |
| Run a selected jobs file. | |
| void | updateGitStatusIcons () |
| Updates the icons shown in the tree project to reflect the current git status. | |
| void | updateGitStatusIconMap (std::shared_ptr< KIGIT_COMMON > aGitCommon, const wxString &aProjectFullName) |
| This is a threaded call that will change the map of git status icons for use in the main thread. | |
| void | updateTreeCache () |
| Updates the map of the wxtreeitemid to the name of each file for use in the thread. | |
| void | releaseGitRepo () |
| Releases the git repository handle, deferring the free to the orphan registry while a background git operation still holds the action mutex. | |
| std::shared_ptr< KIGIT_COMMON > | gitCommon () const |
| The current project's git session, created empty on first use. | |
| void | syncGitListener () |
| Follow the project's git session with a refresh listener, so operations started from the version control panel or the advanced window update the tree's icons and branch label. | |
| git_repository * | gitRepo () const |
| bool | hasLocalCommits () |
| Returns true if the current project has local commits that have not been pushed to the remote repository. | |
| void | shutdownFileWatcher () |
| Shutdown the file watcher. | |
| wxTreeItemId | addItemToProjectTree (const wxString &aName, const wxTreeItemId &aParent, std::vector< wxString > *aProjectNames, bool aRecurse) |
| Add the file or directory aName to the project tree. | |
| wxTreeItemId | findSubdirTreeItem (const wxString &aSubDir) |
| Search for the item in tree project which is the node of the subdirectory aSubDir. | |
| void | onFileSystemEvent (wxFileSystemWatcherEvent &event) |
| called when a file or directory is modified/created/deleted The tree project is modified when a file or directory is created/deleted/renamed to reflect the file change | |
| void | onThemeChanged (wxSysColourChangedEvent &aEvent) |
| void | onGitSyncTimer (wxTimerEvent &event) |
| void | onGitStatusTimer (wxTimerEvent &event) |
| void | gitStatusTimerHandler () |
| void | reportGitSyncResult (bool aFetched, std::optional< KIGIT_FAILURE > aKind, const wxString &aSummary) |
| Background fetches have no window to answer, so each failure goes to the status bar's warnings once, and a transfer that succeeds clears them. | |
Private Attributes | |
| bool | m_isRenaming |
| wxTreeItemId | m_root |
| std::vector< wxString > | m_filters |
| wxFileSystemWatcher * | m_watcher |
| PROJECT_TREE_ITEM * | m_selectedItem |
| bool | m_watcherNeedReset |
| wxString | m_gitCurrentBranchName |
| wxTimer | m_gitSyncTimer |
| wxTimer | m_gitStatusTimer |
| std::future< void > | m_gitSyncTask |
| std::future< void > | m_gitStatusIconTask |
| std::weak_ptr< KIGIT_COMMON > | m_gitListenerSession |
| std::vector< wxString > | m_gitMenuBranches |
| Preserve the shortcut targets while the context menu runs its event loop. | |
| std::weak_ptr< KIGIT_COMMON > | m_gitMenuSession |
| std::unique_ptr< KIGIT_QUERY > | m_branchQuery |
| Owns the branch-switch preflight and suppresses callbacks when the project closes. | |
| std::mutex | m_gitTreeCacheMutex |
| std::unordered_map< wxString, wxTreeItemId > | m_gitTreeCache |
| std::mutex | m_gitStatusMutex |
| std::map< wxTreeItemId, KIGIT_COMMON::GIT_STATUS > | m_gitStatusIcons |
| bool | m_gitIconsInitialized |
Friends | |
| class | PROJECT_TREE_ITEM |
Window to display the tree files.
Definition at line 54 of file project_tree_pane.h.
| PROJECT_TREE_PANE::PROJECT_TREE_PANE | ( | KICAD_MANAGER_FRAME * | parent | ) |
Definition at line 214 of file project_tree_pane.cpp.
References ID_LEFT_FRAME, m_branchQuery, m_filters, m_gitIconsInitialized, m_gitStatusTimer, m_gitSyncTimer, m_isRenaming, m_Parent, m_selectedItem, m_TreeProject, m_watcher, m_watcherNeedReset, onFileSystemEvent(), onGitStatusTimer(), onGitSyncTimer(), onThemeChanged(), PROJECT_TREE_PANE(), ReCreateTreePrj(), and s_allowedExtensionsToList.
Referenced by PROJECT_TREE_PANE().
| PROJECT_TREE_PANE::~PROJECT_TREE_PANE | ( | ) |
Definition at line 249 of file project_tree_pane.cpp.
References m_branchQuery, m_gitListenerSession, m_gitStatusIconTask, m_gitStatusTimer, m_gitSyncTask, m_gitSyncTimer, onFileSystemEvent(), onGitStatusTimer(), onGitSyncTimer(), onThemeChanged(), and shutdownFileWatcher().
|
private |
Add the file or directory aName to the project tree.
| aName | = the filename or the directory name to add in tree |
| aParent | = the wxTreeItemId item where to add sub tree items |
| aProjectNames | |
| aRecurse | = true to add file or subdir names to the current tree item false to stop file add. |
Definition at line 426 of file project_tree_pane.cpp.
References addItemToProjectTree(), alg::contains(), DIRECTORY, PROJECT_TREE_ITEM::GetDir(), GetFileExt(), PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), getProjects(), PROJECT_TREE_ITEM::GetType(), gitRepo(), KIPLATFORM::IO::IsFileHidden(), JSON_PROJECT, LEGACY_PROJECT, LEGACY_SCHEMATIC, m_filters, m_Parent, m_TreeProject, m_watcherNeedReset, MAX, path, PROJECT_TREE_ITEM, PROJECT_TREE_ITEM::SetPopulated(), PROJECT_TREE_ITEM::SetRootFile(), PROJECT_TREE_ITEM::SetState(), SEXPR_SCHEMATIC, and UNKNOWN.
Referenced by addItemToProjectTree(), onCreateNewDirectory(), onExpand(), onFileSystemEvent(), and ReCreateTreePrj().
| void PROJECT_TREE_PANE::EmptyTreePrj | ( | ) |
Delete all m_TreeProject entries.
Definition at line 1646 of file project_tree_pane.cpp.
References KIGIT::ClearSyncWarnings(), m_branchQuery, m_gitMenuBranches, m_gitMenuSession, m_Parent, m_TreeProject, and shutdownFileWatcher().
| void PROJECT_TREE_PANE::FileWatcherReset | ( | ) |
Reinit the watched paths Should be called after opening a new project to rebuild the list of watched paths.
Should be called after the main loop event handler is started
Definition at line 1461 of file project_tree_pane.cpp.
References _, KIPLATFORM::ENV::IsNetworkPath(), m_Parent, m_watcher, m_watcherNeedReset, text, TO_UTF8, tracePathsAndFiles, and wxFileSystemWatcher.
Referenced by onIdle().
|
private |
Search for the item in tree project which is the node of the subdirectory aSubDir.
| aSubDir | = the directory to find in tree |
Definition at line 1275 of file project_tree_pane.cpp.
References DIRECTORY, PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), PROJECT_TREE_ITEM::GetType(), PROJECT_TREE_ITEM::IsPopulated(), m_Parent, m_root, m_TreeProject, and PROJECT_TREE_ITEM.
Referenced by onFileSystemEvent().
|
staticprotected |
Definition at line 358 of file project_tree_pane.cpp.
References FILEEXT::ArchiveFileExtension, CMP_LINK, CSV, FILEEXT::CsvFileExtension, DESIGN_RULES, FILEEXT::DesignRulesFileExtension, DIRECTORY, DRAWING_SHEET, FILEEXT::DrawingSheetFileExtension, DRILL, DRILL_NC, DRILL_XNC, FILEEXT::DrillFileExtension, FOOTPRINT_FILE, FILEEXT::FootprintAssignmentFileExtension, FILEEXT::FootprintPlaceFileExtension, FP_PLACE, GERBER, GERBER_JOB_FILE, FILEEXT::GerberFileExtensionsRegex, FILEEXT::GerberJobFileExtension, HTML, FILEEXT::HtmlFileExtension, JOBSET_FILE, JSON_PROJECT, FILEEXT::KiCadFootprintFileExtension, FILEEXT::KiCadJobSetFileExtension, FILEEXT::KiCadPcbFileExtension, FILEEXT::KiCadSchematicFileExtension, FILEEXT::KiCadSymbolLibFileExtension, LEGACY_PCB, LEGACY_PROJECT, LEGACY_SCHEMATIC, FILEEXT::LegacyPcbFileExtension, FILEEXT::LegacyProjectFileExtension, FILEEXT::LegacySchematicFileExtension, FILEEXT::LegacySymbolLibFileExtension, FILEEXT::MarkdownFileExtension, MAX, MD, NET, NET_SPICE, FILEEXT::NetlistFileExtension, PDF, FILEEXT::PdfFileExtension, FILEEXT::ProjectFileExtension, REPORT, FILEEXT::ReportFileExtension, ROOT, SCHEMATIC_LIBFILE, SEXPR_PCB, SEXPR_SCHEMATIC, SEXPR_SYMBOL_LIB_FILE, FILEEXT::SpiceFileExtension, SVG, FILEEXT::SVGFileExtension, FILEEXT::TextFileExtension, TXT, UNKNOWN, and ZIP_ARCHIVE.
Referenced by addItemToProjectTree(), and PROJECT_TREE_ITEM::Rename().
|
protected |
Return the item data corresponding to a wxTreeItemId identifier.
| aId | = the wxTreeItemId identifier. |
Definition at line 1269 of file project_tree_pane.cpp.
References m_TreeProject, and PROJECT_TREE_ITEM.
Referenced by addItemToProjectTree(), findSubdirTreeItem(), GetSelectedData(), onExpand(), onFileSystemEvent(), onGitInitializeProject(), onIdle(), updateGitStatusIcons(), and updateTreeCache().
|
protected |
Return the item data from item currently selected (highlighted)
Definition at line 1245 of file project_tree_pane.cpp.
References GetItemIdData(), m_TreeProject, PROJECT_TREE_ITEM, and traceGit.
Referenced by onCreateNewDirectory(), onDeleteFile(), onOpenDirectory(), onOpenSelectedFileWithTextEditor(), onRenameFile(), onSelect(), onSwitchToSelectedProject(), and showContextMenu().
|
private |
The current project's git session, created empty on first use.
Definition at line 1743 of file project_tree_pane.cpp.
References PROJECT::GetGitCommon(), and Prj().
Referenced by gitRepo(), gitStatusTimerHandler(), onGitInitializeProject(), onGitRemoteSettings(), onGitSwitchBranch(), onGitSyncTimer(), showContextMenu(), switchGitBranch(), syncGitListener(), and WaitForGitOperations().
|
private |
Definition at line 1777 of file project_tree_pane.cpp.
References KIGIT_COMMON::GetRepo(), git_repository, and gitCommon().
Referenced by addItemToProjectTree(), ReCreateTreePrj(), showContextMenu(), and WaitForGitOperations().
|
private |
Definition at line 2545 of file project_tree_pane.cpp.
References GetKiCadThreadPool(), PROJECT::GetProjectFullName(), gitCommon(), gitTaskStillRunning(), m_gitStatusIconTask, m_TreeProject, Prj(), tp, updateGitStatusIconMap(), and updateTreeCache().
Referenced by onGitStatusTimer(), and onGitSyncTimer().
|
private |
Returns true if the current project has local commits that have not been pushed to the remote repository.
|
private |
Creates a new subdirectory inside the current kicad project directory the user is prompted to enter a directory name.
Definition at line 328 of file project_tree_pane.cpp.
References _, addItemToProjectTree(), GetSelectedData(), m_Parent, and PROJECT_TREE_ITEM.
|
private |
Delete the selected file or directory in the tree project.
Definition at line 1095 of file project_tree_pane.cpp.
References GetSelectedData(), and PROJECT_TREE_ITEM.
|
private |
Called on a click on the + or - button of an item with children.
Definition at line 1180 of file project_tree_pane.cpp.
References addItemToProjectTree(), DIRECTORY, PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), getProjects(), PROJECT_TREE_ITEM::GetType(), PROJECT_TREE_ITEM::IsPopulated(), m_TreeProject, m_watcherNeedReset, name, PROJECT_TREE_ITEM, and PROJECT_TREE_ITEM::SetPopulated().
|
private |
called when a file or directory is modified/created/deleted The tree project is modified when a file or directory is created/deleted/renamed to reflect the file change
Definition at line 1333 of file project_tree_pane.cpp.
References addItemToProjectTree(), findSubdirTreeItem(), PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), m_gitStatusTimer, m_isRenaming, m_TreeProject, m_watcher, PROJECT_TREE_ITEM, and traceGit.
Referenced by PROJECT_TREE_PANE(), and ~PROJECT_TREE_PANE().
|
private |
Initialize a new git repository in the current project directory.
Definition at line 1838 of file project_tree_pane.cpp.
References _, KIGIT_COMMON::ACTION_LOCK_WAIT, CANCELLED, KIGIT::ClearSyncWarnings(), KIGIT::PROJECT_GIT_UTILS::ComputeSymlinkPreservingWorkDir(), RemoteConfig::connType, KIGIT_ERROR_MESSAGE::details, DisplayErrorMessage(), DisplayInfoMessage(), PROJECT_TREE_ITEM::GetDir(), KIGIT_REPO_MIXIN::GetFailureKind(), KIGIT_REPO_MIXIN::GetHostKeyFailure(), GetItemIdData(), DIALOG_GIT_REPOSITORY::GetPassword(), KIGIT_REPO_MIXIN::GetRepo(), DIALOG_GIT_REPOSITORY::GetRepoSSHPath(), DIALOG_GIT_REPOSITORY::GetRepoType(), DIALOG_GIT_REPOSITORY::GetRepoURL(), DIALOG_GIT_REPOSITORY::GetUsername(), gitCommon(), GIT_INIT_HANDLER::InitializeRepository(), GIT_INIT_HANDLER::IsRepository(), m_Parent, m_TreeProject, RemoteConfig::password, GIT_PULL_HANDLER::PerformFetch(), KIGIT_ERRORS::PopError(), PR_NO_ABORT, Prj(), PROJECT_TREE_ITEM, promptForGitCredentials(), KIGIT::PromptToTrustHost(), result, saveAcceptedRemoteSettings(), KIGIT_REPO_MIXIN::SetActionLockWait(), GIT_PROGRESS::SetProgressReporter(), KIGIT_COMMON::SetProjectDir(), KIGIT_COMMON::SetShuttingDown(), DIALOG_GIT_REPOSITORY::SetSkipButtonLabel(), GIT_INIT_HANDLER::SetupRemote(), DIALOG_SHIM::ShowModal(), RemoteConfig::sshKey, Success, KIGIT_ERROR_MESSAGE::summary, RemoteConfig::url, RemoteConfig::username, and KIGIT_REPO_MIXIN::WasAuthFailure().
|
private |
Configure (or change) the default remote on an already-initialized repository.
Definition at line 1952 of file project_tree_pane.cpp.
References _, RemoteConfig::connType, KIGIT_ERROR_MESSAGE::details, DisplayErrorMessage(), DIALOG_GIT_REPOSITORY::GetPassword(), KIGIT_COMMON::GetPassword(), KIGIT_COMMON::GetRepo(), DIALOG_GIT_REPOSITORY::GetRepoSSHPath(), DIALOG_GIT_REPOSITORY::GetRepoType(), DIALOG_GIT_REPOSITORY::GetRepoURL(), DIALOG_GIT_REPOSITORY::GetUsername(), KIGIT_COMMON::GetUsername(), git_repository, gitCommon(), m_gitStatusTimer, RemoteConfig::password, KIGIT_ERRORS::PopError(), Prj(), saveAcceptedRemoteSettings(), DIALOG_GIT_REPOSITORY::SetPassword(), KIGIT_COMMON::SetRemote(), DIALOG_GIT_REPOSITORY::SetRepoSSHPath(), GIT_INIT_HANDLER::SetupRemote(), DIALOG_GIT_REPOSITORY::SetUsername(), KIGIT_COMMON::SetUsername(), DIALOG_SHIM::ShowModal(), RemoteConfig::sshKey, KIGIT_ERROR_MESSAGE::summary, KIGIT::TryLockAction(), KIGIT_COMMON::UpdateCurrentBranchInfo(), RemoteConfig::url, RemoteConfig::username, and KIGIT::WaitForActionLock().
|
private |
Remove the git repository from the current project directory.
Definition at line 2154 of file project_tree_pane.cpp.
References PROJECT::AttachGitRepository(), PROJECT::GetLocalSettings(), m_gitIconsInitialized, PROJECT_LOCAL_SETTINGS::m_GitIntegrationDisabled, m_TreeProject, Prj(), releaseGitRepo(), PROJECT_LOCAL_SETTINGS::SaveToFile(), and traceGit.
|
private |
Definition at line 2574 of file project_tree_pane.cpp.
References gitStatusTimerHandler(), m_TreeProject, Pgm(), and traceGit.
Referenced by PROJECT_TREE_PANE(), and ~PROJECT_TREE_PANE().
|
private |
Switch to a different branch in the git repository.
Definition at line 2036 of file project_tree_pane.cpp.
References KIGIT_COMMON::GetBranches(), DIALOG_GIT_SWITCH::GetBranchName(), gitCommon(), ID_GIT_SWITCH_BRANCH, ID_GIT_SWITCH_QUICK1, m_branchQuery, m_gitMenuBranches, m_gitMenuSession, Pgm(), Prj(), DIALOG_SHIM::ShowModal(), and switchGitBranch().
|
private |
Definition at line 2445 of file project_tree_pane.cpp.
References COMMON_SETTINGS::GIT::enableGit, PGM_BASE::GetCommonSettings(), KIGIT_REPO_MIXIN::GetFailureKind(), gitCommon(), gitStatusTimerHandler(), gitTaskStillRunning(), COMMON_SETTINGS::m_Git, m_gitSyncTask, m_gitSyncTimer, m_TreeProject, GIT_PULL_HANDLER::PerformFetch(), Pgm(), KIGIT_ERRORS::PopError(), reportGitSyncResult(), KIGIT_ERROR_MESSAGE::summary, traceGit, and COMMON_SETTINGS::GIT::updatInterval.
Referenced by PROJECT_TREE_PANE(), and ~PROJECT_TREE_PANE().
|
private |
Idle event handler, used process the selected items at a point in time when all other events have been consumed.
Definition at line 1147 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::Activate(), FileWatcherReset(), GetItemIdData(), m_selectedItem, m_TreeProject, m_watcherNeedReset, and PROJECT_TREE_ITEM.
|
private |
Handles the right-click menu for opening a directory in the current system file browser.
Definition at line 300 of file project_tree_pane.cpp.
References PATHS::GetDefaultUserProjectsPath(), GetSelectedData(), LaunchExternal(), m_Parent, and PROJECT_TREE_ITEM.
|
private |
Call the text editor to open the selected file in the tree project.
Definition at line 1071 of file project_tree_pane.cpp.
References _, ExecuteFile(), GetSelectedData(), PGM_BASE::GetTextEditor(), Pgm(), and PROJECT_TREE_ITEM.
|
private |
We don't have uniform borders so we have to draw them ourselves.
Definition at line 1793 of file project_tree_pane.cpp.
|
private |
Rename the selected file or directory in the tree project.
Definition at line 1104 of file project_tree_pane.cpp.
References _, GetSelectedData(), m_isRenaming, and m_TreeProject.
|
private |
Called on a right click on an item.
Definition at line 765 of file project_tree_pane.cpp.
References m_TreeProject, and showContextMenu().
|
private |
Run a selected jobs file.
Definition at line 2440 of file project_tree_pane.cpp.
|
private |
Called on a double click on an item.
Definition at line 1133 of file project_tree_pane.cpp.
References GetSelectedData(), and m_selectedItem.
|
private |
Switch to a other project selected from the tree project (by selecting an other .pro file inside the current project folder)
Definition at line 287 of file project_tree_pane.cpp.
References GetSelectedData(), and m_Parent.
|
private |
Definition at line 1783 of file project_tree_pane.cpp.
References GetBitmapStore(), m_TreeProject, and BITMAP_STORE::ThemeChanged().
Referenced by PROJECT_TREE_PANE(), and ~PROJECT_TREE_PANE().
| void PROJECT_TREE_PANE::ReCreateTreePrj | ( | ) |
Create or modify the tree showing project file names.
Definition at line 645 of file project_tree_pane.cpp.
References addItemToProjectTree(), PROJECT::AttachGitRepository(), PATHS::GetDefaultUserProjectsPath(), getProjects(), gitRepo(), JSON_PROJECT, FILEEXT::LegacyProjectFileExtension, m_gitIconsInitialized, m_gitStatusIcons, m_gitStatusMutex, m_gitStatusTimer, m_gitSyncTimer, m_gitTreeCache, m_gitTreeCacheMutex, m_Parent, m_root, m_TreeProject, name, NAMELESS_PROJECT, Pgm(), Prj(), PROJECT_TREE_ITEM, FILEEXT::ProjectFileExtension, releaseGitRepo(), ROOT, syncGitListener(), and traceGit.
Referenced by PROJECT_TREE_PANE().
|
private |
Releases the git repository handle, deferring the free to the orphan registry while a background git operation still holds the action mutex.
Definition at line 1734 of file project_tree_pane.cpp.
References m_branchQuery, m_gitMenuBranches, m_gitMenuSession, Prj(), and PROJECT::ReleaseGitCommon().
Referenced by onGitRemoveVCS(), and ReCreateTreePrj().
|
private |
Background fetches have no window to answer, so each failure goes to the status bar's warnings once, and a transfer that succeeds clears them.
Definition at line 2513 of file project_tree_pane.cpp.
References KISTATUSBAR::AddWarningMessages(), CANCELLED, KIGIT::ClearSyncWarnings(), KISTATUSBAR::GetWarningMessages(), m_Parent, RPT_SEVERITY_WARNING, KI_ERROR::SetSeverity(), KI_ERROR::SetTitle(), and KIGIT::SYNC_WARNING_SOURCE.
Referenced by onGitSyncTimer().
|
private |
Definition at line 782 of file project_tree_pane.cpp.
References _, KIUI::AddMenuItem(), DIRECTORY, directory, directory_browser, editor, COMMON_SETTINGS::GIT::enableGit, exchange, PGM_BASE::GetCommonSettings(), GetGitBackend(), PROJECT::GetLocalSettings(), GetSelectedData(), gitCommon(), gitRepo(), ID_GIT_INITIALIZE_PROJECT, ID_GIT_REMOTE_SETTINGS, ID_GIT_REMOVE_VCS, ID_GIT_SWITCH_BRANCH, ID_GIT_SWITCH_QUICK1, ID_JOBS_RUN, ID_PROJECT_DELETE, ID_PROJECT_NEWDIR, ID_PROJECT_OPEN_DIR, ID_PROJECT_RENAME, ID_PROJECT_SWITCH_TO_OTHER, ID_PROJECT_TXTEDIT, GIT_BACKEND::IsLibraryAvailable(), JOBSET_FILE, JSON_PROJECT, KI_FALLTHROUGH, KiBitmap(), LEGACY_PROJECT, COMMON_SETTINGS::m_Git, PROJECT_LOCAL_SETTINGS::m_GitIntegrationDisabled, m_gitMenuBranches, m_gitMenuSession, m_TreeProject, open_project, PDF, Pgm(), Prj(), PROJECT_TREE_ITEM, right, SEXPR_PCB, SEXPR_SCHEMATIC, KIGIT::SortBranchesForDisplay(), text, trash, and ZIP_ARCHIVE.
Referenced by onRight().
|
private |
Shutdown the file watcher.
Used when closing to prevent post-free access into the project tree. (Using the destructor doesn't work as wxWidgets defers destruction in some cases.)
Definition at line 275 of file project_tree_pane.cpp.
References m_watcher.
Referenced by EmptyTreePrj(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 2096 of file project_tree_pane.cpp.
References _, KIGIT::BranchNameError(), KIGIT::PROJECT_GIT_UTILS::CreateBranch(), DisplayErrorMessage(), KIGIT_COMMON::GetLastGitError(), gitCommon(), m_branchQuery, m_Parent, Pgm(), Prj(), ProjectClearOfUncommittedWork(), result, SwitchProjectToBranch(), and KIGIT::WaitForActionLock().
Referenced by onGitSwitchBranch().
|
private |
Follow the project's git session with a refresh listener, so operations started from the version control panel or the advanced window update the tree's icons and branch label.
Definition at line 1749 of file project_tree_pane.cpp.
References KIGIT::ClearSyncWarnings(), gitCommon(), m_branchQuery, m_gitListenerSession, m_gitMenuBranches, m_gitMenuSession, m_gitStatusTimer, m_Parent, and m_TreeProject.
Referenced by ReCreateTreePrj().
|
private |
This is a threaded call that will change the map of git status icons for use in the main thread.
Definition at line 2318 of file project_tree_pane.cpp.
References ADVANCED_CFG::GetCfg(), GIT_STATUS_HANDLER::GetCurrentBranchName(), GIT_STATUS_HANDLER::GetFileStatus(), GIT_STATUS_HANDLER::GetWorkingDirectory(), KIPLATFORM::ENV::IsNetworkPath(), m_gitCurrentBranchName, ADVANCED_CFG::m_GitIconRefreshInterval, m_gitIconsInitialized, m_gitStatusIcons, m_gitStatusMutex, m_gitStatusTimer, m_gitTreeCache, m_gitTreeCacheMutex, m_TreeProject, Pgm(), refresh, traceGit, updateGitStatusIcons(), and GIT_STATUS_HANDLER::UpdateRemoteStatus().
Referenced by gitStatusTimerHandler().
|
private |
Updates the icons shown in the tree project to reflect the current git status.
Definition at line 2202 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), m_gitCurrentBranchName, m_gitIconsInitialized, m_gitStatusIcons, m_gitStatusMutex, m_gitStatusTimer, m_TreeProject, Pgm(), PROJECT_TREE_ITEM, and traceGit.
Referenced by updateGitStatusIconMap().
|
private |
Updates the map of the wxtreeitemid to the name of each file for use in the thread.
Definition at line 2262 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), m_gitTreeCache, m_gitTreeCacheMutex, m_TreeProject, PROJECT_TREE_ITEM, and traceGit.
Referenced by gitStatusTimerHandler().
| void PROJECT_TREE_PANE::WaitForGitOperations | ( | ) |
Give a running background git operation a chance to finish, asking the user to keep waiting or abandon.
Call before the owning project is unloaded.
Definition at line 1660 of file project_tree_pane.cpp.
References _, git_repository, gitCommon(), gitRepo(), m_branchQuery, Prj(), PROJECT::ReleaseGitCommon(), and KIGIT::PROJECT_GIT_UTILS::RemoveVCS().
|
friend |
Definition at line 56 of file project_tree_pane.h.
References git_repository, and PROJECT_TREE_ITEM.
Referenced by addItemToProjectTree(), findSubdirTreeItem(), GetItemIdData(), GetSelectedData(), onCreateNewDirectory(), onDeleteFile(), onExpand(), onFileSystemEvent(), onGitInitializeProject(), onIdle(), onOpenDirectory(), onOpenSelectedFileWithTextEditor(), PROJECT_TREE_ITEM, ReCreateTreePrj(), showContextMenu(), updateGitStatusIcons(), and updateTreeCache().
|
private |
Owns the branch-switch preflight and suppresses callbacks when the project closes.
Definition at line 301 of file project_tree_pane.h.
Referenced by EmptyTreePrj(), onGitSwitchBranch(), PROJECT_TREE_PANE(), releaseGitRepo(), switchGitBranch(), syncGitListener(), WaitForGitOperations(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 282 of file project_tree_pane.h.
Referenced by addItemToProjectTree(), and PROJECT_TREE_PANE().
|
private |
Definition at line 288 of file project_tree_pane.h.
Referenced by updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 307 of file project_tree_pane.h.
Referenced by onGitRemoveVCS(), PROJECT_TREE_PANE(), ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 294 of file project_tree_pane.h.
Referenced by syncGitListener(), and ~PROJECT_TREE_PANE().
|
private |
Preserve the shortcut targets while the context menu runs its event loop.
Definition at line 297 of file project_tree_pane.h.
Referenced by EmptyTreePrj(), onGitSwitchBranch(), releaseGitRepo(), showContextMenu(), and syncGitListener().
|
private |
Definition at line 298 of file project_tree_pane.h.
Referenced by EmptyTreePrj(), onGitSwitchBranch(), releaseGitRepo(), showContextMenu(), and syncGitListener().
|
private |
Definition at line 306 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 292 of file project_tree_pane.h.
Referenced by gitStatusTimerHandler(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 305 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 290 of file project_tree_pane.h.
Referenced by onFileSystemEvent(), onGitRemoteSettings(), PROJECT_TREE_PANE(), ReCreateTreePrj(), syncGitListener(), updateGitStatusIconMap(), updateGitStatusIcons(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 291 of file project_tree_pane.h.
Referenced by onGitSyncTimer(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 289 of file project_tree_pane.h.
Referenced by onGitSyncTimer(), PROJECT_TREE_PANE(), ReCreateTreePrj(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 304 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateTreeCache().
|
private |
Definition at line 303 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateTreeCache().
|
private |
Definition at line 280 of file project_tree_pane.h.
Referenced by onFileSystemEvent(), onRenameFile(), and PROJECT_TREE_PANE().
| KICAD_MANAGER_FRAME* PROJECT_TREE_PANE::m_Parent |
Definition at line 276 of file project_tree_pane.h.
Referenced by PROJECT_TREE_ITEM::Activate(), addItemToProjectTree(), EmptyTreePrj(), FileWatcherReset(), findSubdirTreeItem(), onCreateNewDirectory(), onGitInitializeProject(), onOpenDirectory(), onSwitchToSelectedProject(), PROJECT_TREE_PANE(), ReCreateTreePrj(), reportGitSyncResult(), switchGitBranch(), and syncGitListener().
|
private |
Definition at line 281 of file project_tree_pane.h.
Referenced by findSubdirTreeItem(), and ReCreateTreePrj().
|
private |
Definition at line 284 of file project_tree_pane.h.
Referenced by onIdle(), onSelect(), and PROJECT_TREE_PANE().
| PROJECT_TREE* PROJECT_TREE_PANE::m_TreeProject |
Definition at line 277 of file project_tree_pane.h.
Referenced by PROJECT_TREE_ITEM::Activate(), addItemToProjectTree(), EmptyTreePrj(), findSubdirTreeItem(), GetItemIdData(), GetSelectedData(), gitStatusTimerHandler(), onExpand(), onFileSystemEvent(), onGitInitializeProject(), onGitRemoveVCS(), onGitStatusTimer(), onGitSyncTimer(), onIdle(), onRenameFile(), onRight(), onThemeChanged(), PROJECT_TREE_PANE(), ReCreateTreePrj(), showContextMenu(), syncGitListener(), updateGitStatusIconMap(), updateGitStatusIcons(), and updateTreeCache().
|
private |
Definition at line 283 of file project_tree_pane.h.
Referenced by FileWatcherReset(), onFileSystemEvent(), PROJECT_TREE_PANE(), and shutdownFileWatcher().
|
private |
Definition at line 285 of file project_tree_pane.h.
Referenced by addItemToProjectTree(), FileWatcherReset(), onExpand(), onIdle(), and PROJECT_TREE_PANE().