KiCad PCB EDA Suite
|
PROJECT_TREE_PANE 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. | |
Public Attributes | |
KICAD_MANAGER_FRAME * | m_Parent |
PROJECT_TREE * | m_TreeProject |
Protected Member Functions | |
std::vector< PROJECT_TREE_ITEM * > | GetSelectedData () |
Function GetSelectedData return the item data from item currently selected (highlighted) Note this is not necessary the "clicked" item, because when expanding, collapsing an item this item is not selected. | |
PROJECT_TREE_ITEM * | GetItemIdData (wxTreeItemId aId) |
Function GetItemIdData 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 | onOpenSelectedFileWithTextEditor (wxCommandEvent &event) |
Function onOpenSelectedFileWithTextEditor Call the text editor to open the selected file in the tree project. | |
void | onDeleteFile (wxCommandEvent &event) |
Function onDeleteFile Delete the selected file or directory in the tree project. | |
void | onRenameFile (wxCommandEvent &event) |
Function onRenameFile Rename the selected file or directory in the tree project. | |
void | onOpenDirectory (wxCommandEvent &event) |
Function onOpenDirectory Handles the right-click menu for opening a directory in the current system file browser. | |
void | onCreateNewDirectory (wxCommandEvent &event) |
Function onCreateNewDirectory 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 | onGitCommit (wxCommandEvent &event) |
Commit the current project saved changes to the git repository. | |
void | onGitPullProject (wxCommandEvent &event) |
Pull the latest changes from the git repository. | |
void | onGitPushProject (wxCommandEvent &event) |
Push the current project changes to the git repository. | |
void | onGitSwitchBranch (wxCommandEvent &event) |
Switch to a different branch in the git repository. | |
void | onGitCompare (wxCommandEvent &event) |
Compare the current project to a different branch in the git repository. | |
void | onGitRemoveVCS (wxCommandEvent &event) |
Remove the git repository from the current project directory. | |
void | onGitAddToIndex (wxCommandEvent &event) |
Add a file to the git index. | |
void | onGitRemoveFromIndex (wxCommandEvent &event) |
Remove a file from the git index. | |
void | onGitSyncProject (wxCommandEvent &event) |
Sync the current project with the git repository. | |
void | onGitFetch (wxCommandEvent &event) |
Fetch the latest changes from the git repository. | |
void | onGitResolveConflict (wxCommandEvent &event) |
Resolve conflicts in the git repository. | |
void | onGitRevertLocal (wxCommandEvent &event) |
Revert the local repository to the last commit. | |
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 () |
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. | |
bool | hasChangedFiles () |
Returns true if the current project has any uncommitted changes. | |
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) |
Function addItemToProjectTree. | |
wxTreeItemId | findSubdirTreeItem (const wxString &aSubDir) |
Function findSubdirTreeItem searches 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) |
bool | canFileBeAddedToVCS (const wxString &aFilePath) |
Returns true if the file has already been added to the repository or false if it has not been added yet. | |
void | onGitSyncTimer (wxTimerEvent &event) |
void | onGitStatusTimer (wxTimerEvent &event) |
void | gitStatusTimerHandler () |
Private Attributes | |
bool | m_isRenaming |
wxTreeItemId | m_root |
std::vector< wxString > | m_filters |
wxFileSystemWatcher * | m_watcher |
PROJECT_TREE_ITEM * | m_selectedItem |
bool | m_watcherNeedReset |
int | m_gitLastError |
wxString | m_gitCurrentBranchName |
wxTimer | m_gitSyncTimer |
wxTimer | m_gitStatusTimer |
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 |
PROJECT_TREE_PANE 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 187 of file project_tree_pane.cpp.
References onFileSystemEvent(), onGitStatusTimer(), onGitSyncTimer(), onThemeChanged(), and s_allowedExtensionsToList.
PROJECT_TREE_PANE::~PROJECT_TREE_PANE | ( | ) |
Definition at line 223 of file project_tree_pane.cpp.
References m_gitStatusTimer, m_gitSyncTimer, onFileSystemEvent(), onGitStatusTimer(), onGitSyncTimer(), onThemeChanged(), and shutdownFileWatcher().
|
private |
Function addItemToProjectTree.
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 |
aRecurse | = true to add file or subdir names to the current tree item false to stop file add. |
Definition at line 411 of file project_tree_pane.cpp.
References addItemToProjectTree(), alg::contains(), PROJECT_TREE_ITEM::GetDir(), GetFileExt(), PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), KICAD_MANAGER_FRAME::GetProjectFileName(), getProjects(), PROJECT_TREE_ITEM::GetType(), KIPLATFORM::IO::IsFileHidden(), m_filters, m_Parent, m_TreeProject, m_watcherNeedReset, path, project, PROJECT_TREE_ITEM, PROJECT_TREE_ITEM::SetPopulated(), PROJECT_TREE_ITEM::SetRootFile(), and PROJECT_TREE_ITEM::SetState().
Referenced by addItemToProjectTree(), onCreateNewDirectory(), onExpand(), onFileSystemEvent(), and ReCreateTreePrj().
|
private |
Returns true if the file has already been added to the repository or false if it has not been added yet.
Definition at line 2590 of file project_tree_pane.cpp.
References PROJECT_TREE::GetGitRepo(), KIGIT_COMMON::GetLastGitError(), m_TreeProject, and traceGit.
void PROJECT_TREE_PANE::EmptyTreePrj | ( | ) |
Delete all m_TreeProject entries.
Definition at line 1577 of file project_tree_pane.cpp.
References PROJECT_TREE::GetGitRepo(), m_TreeProject, PROJECT_TREE::SetGitRepo(), and shutdownFileWatcher().
Referenced by KICAD_MANAGER_FRAME::CloseProject().
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 1436 of file project_tree_pane.cpp.
References _, KICAD_MANAGER_FRAME::GetProjectFileName(), KIPLATFORM::ENV::IsNetworkPath(), KICAD_MANAGER_FRAME::m_FileWatcherInfo, m_Parent, m_watcher, m_watcherNeedReset, KISTATUSBAR::SetEllipsedTextField(), TO_UTF8, tracePathsAndFiles, and wxFileSystemWatcher.
Referenced by KICAD_MANAGER_FRAME::OnChangeWatchedPaths(), onIdle(), and KICAD_MANAGER_FRAME::ShowChangedLanguage().
|
private |
Function findSubdirTreeItem searches for the item in tree project which is the node of the subdirectory aSubDir.
aSubDir | = the directory to find in tree |
Definition at line 1255 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), KICAD_MANAGER_FRAME::GetProjectFileName(), PROJECT_TREE_ITEM::GetType(), PROJECT_TREE_ITEM::IsPopulated(), m_Parent, m_root, and m_TreeProject.
Referenced by onFileSystemEvent().
|
staticprotected |
Definition at line 323 of file project_tree_pane.cpp.
References FILEEXT::ArchiveFileExtension, FILEEXT::DesignRulesFileExtension, FILEEXT::DrawingSheetFileExtension, FILEEXT::DrillFileExtension, FILEEXT::FootprintAssignmentFileExtension, FILEEXT::FootprintPlaceFileExtension, FILEEXT::GerberFileExtensionsRegex, FILEEXT::GerberJobFileExtension, FILEEXT::HtmlFileExtension, FILEEXT::KiCadFootprintFileExtension, FILEEXT::KiCadJobSetFileExtension, FILEEXT::KiCadPcbFileExtension, FILEEXT::KiCadSchematicFileExtension, FILEEXT::KiCadSymbolLibFileExtension, FILEEXT::LegacyPcbFileExtension, FILEEXT::LegacyProjectFileExtension, FILEEXT::LegacySchematicFileExtension, FILEEXT::LegacySymbolLibFileExtension, FILEEXT::MarkdownFileExtension, FILEEXT::NetlistFileExtension, FILEEXT::PdfFileExtension, FILEEXT::ProjectFileExtension, FILEEXT::ReportFileExtension, FILEEXT::SpiceFileExtension, FILEEXT::SVGFileExtension, and FILEEXT::TextFileExtension.
Referenced by addItemToProjectTree(), and PROJECT_TREE_ITEM::Rename().
|
protected |
Function GetItemIdData return the item data corresponding to a wxTreeItemId identifier.
aId | = the wxTreeItemId identifier. |
Definition at line 1249 of file project_tree_pane.cpp.
References m_TreeProject.
Referenced by addItemToProjectTree(), findSubdirTreeItem(), GetSelectedData(), onExpand(), onFileSystemEvent(), onGitInitializeProject(), updateGitStatusIconMap(), updateGitStatusIcons(), and updateTreeCache().
|
protected |
Function GetSelectedData return the item data from item currently selected (highlighted) Note this is not necessary the "clicked" item, because when expanding, collapsing an item this item is not selected.
Definition at line 1224 of file project_tree_pane.cpp.
References GetItemIdData(), m_TreeProject, and traceGit.
Referenced by onCreateNewDirectory(), onDeleteFile(), onGitCommit(), onOpenDirectory(), onOpenSelectedFileWithTextEditor(), onRenameFile(), onRight(), onSelect(), and onSwitchToSelectedProject().
|
private |
Definition at line 2729 of file project_tree_pane.cpp.
References GetKiCadThreadPool(), tp, updateGitStatusIconMap(), and updateTreeCache().
Referenced by onGitStatusTimer(), and onGitSyncTimer().
|
private |
Returns true if the current project has any uncommitted changes.
Definition at line 743 of file project_tree_pane.cpp.
References _, PROJECT_TREE::GetGitRepo(), KIGIT_COMMON::GetLastGitError(), and m_TreeProject.
Referenced by onRight().
|
private |
Returns true if the current project has local commits that have not been pushed to the remote repository.
|
private |
Function onCreateNewDirectory Creates a new subdirectory inside the current kicad project directory the user is prompted to enter a directory name.
Definition at line 293 of file project_tree_pane.cpp.
References _, addItemToProjectTree(), KICAD_MANAGER_FRAME::GetProjectFileName(), GetSelectedData(), and m_Parent.
|
private |
Function onDeleteFile Delete the selected file or directory in the tree project.
Definition at line 1085 of file project_tree_pane.cpp.
References GetSelectedData().
|
private |
Called on a click on the + or - button of an item with children.
Definition at line 1159 of file project_tree_pane.cpp.
References addItemToProjectTree(), PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), getProjects(), PROJECT_TREE_ITEM::GetType(), PROJECT_TREE_ITEM::IsPopulated(), m_TreeProject, m_watcherNeedReset, name, 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 1313 of file project_tree_pane.cpp.
References addItemToProjectTree(), findSubdirTreeItem(), PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), m_gitStatusTimer, m_isRenaming, m_TreeProject, m_watcher, and traceGit.
Referenced by PROJECT_TREE_PANE(), and ~PROJECT_TREE_PANE().
|
private |
Add a file to the git index.
Definition at line 2584 of file project_tree_pane.cpp.
|
private |
Commit the current project saved changes to the git repository.
Definition at line 2300 of file project_tree_pane.cpp.
References _, COMMON_SETTINGS::GIT::authorEmail, COMMON_SETTINGS::GIT::authorName, FILEEXT::AutoSaveFilePrefix, FILEEXT::BackupFileSuffix, config, DIALOG_GIT_COMMIT::GetAuthorEmail(), DIALOG_GIT_COMMIT::GetAuthorName(), DIALOG_GIT_COMMIT::GetCommitMessage(), PGM_BASE::GetCommonSettings(), PROJECT_TREE::GetGitRepo(), KIGIT_COMMON::GetLastGitError(), PROJECT::GetProjectPath(), GetSelectedData(), DIALOG_GIT_COMMIT::GetSelectedFiles(), ID_GIT_COMMIT_PROJECT, FILEEXT::LockFileExtension, FILEEXT::LockFilePrefix, COMMON_SETTINGS::m_Git, m_gitStatusTimer, m_TreeProject, Pgm(), Prj(), DIALOG_SHIM::ShowModal(), and traceGit.
|
private |
Compare the current project to a different branch in the git repository.
Definition at line 1751 of file project_tree_pane.cpp.
|
private |
Fetch the latest changes from the git repository.
Definition at line 2635 of file project_tree_pane.cpp.
References PROJECT_TREE::GitCommon(), m_gitStatusTimer, m_TreeProject, and GIT_PULL_HANDLER::PerformFetch().
|
private |
Initialize a new git repository in the current project directory.
Definition at line 1622 of file project_tree_pane.cpp.
References _, DisplayErrorMessage(), DisplayInfoMessage(), DIALOG_GIT_REPOSITORY::GetBareRepoURL(), PROJECT_TREE_ITEM::GetDir(), GetItemIdData(), KIGIT_COMMON::GetLastGitError(), PROJECT::GetLocalSettings(), DIALOG_GIT_REPOSITORY::GetPassword(), DIALOG_GIT_REPOSITORY::GetRepoSSHPath(), DIALOG_GIT_REPOSITORY::GetRepoType(), DIALOG_GIT_REPOSITORY::GetRepoURL(), DIALOG_GIT_REPOSITORY::GetUsername(), KIGIT_COMMON::GIT_CONN_HTTPS, KIGIT_COMMON::GIT_CONN_SSH, PROJECT_TREE::GitCommon(), m_gitLastError, PROJECT_LOCAL_SETTINGS::m_GitRepoType, PROJECT_LOCAL_SETTINGS::m_GitRepoUsername, PROJECT_LOCAL_SETTINGS::m_GitSSHKey, m_TreeProject, GIT_PULL_HANDLER::PerformFetch(), Prj(), PROJECT_TREE::SetGitRepo(), KIGIT_COMMON::SetPassword(), GIT_PROGRESS::SetProgressReporter(), KIGIT_COMMON::SetSSHKey(), KIGIT_COMMON::SetUsername(), DIALOG_SHIM::ShowModal(), and KIPLATFORM::SECRETS::StoreSecret().
|
private |
Pull the latest changes from the git repository.
Definition at line 1757 of file project_tree_pane.cpp.
References _, DisplayErrorMessage(), KIGIT_ERRORS::GetErrorString(), PROJECT_TREE::GetGitRepo(), PROJECT_TREE::GitCommon(), m_gitStatusTimer, m_TreeProject, GIT_PULL_HANDLER::PerformPull(), and GIT_PROGRESS::SetProgressReporter().
|
private |
Push the current project changes to the git repository.
Definition at line 1781 of file project_tree_pane.cpp.
References _, DisplayErrorMessage(), KIGIT_ERRORS::GetErrorString(), PROJECT_TREE::GetGitRepo(), PROJECT_TREE::GitCommon(), m_gitStatusTimer, m_TreeProject, GIT_PUSH_HANDLER::PerformPush(), and GIT_PROGRESS::SetProgressReporter().
|
private |
Remove a file from the git index.
Definition at line 2673 of file project_tree_pane.cpp.
References PROJECT_TREE::GetGitRepo(), m_TreeProject, and GIT_REMOVE_FROM_INDEX_HANDLER::PerformRemoveFromIndex().
|
private |
Remove the git repository from the current project directory.
Definition at line 1917 of file project_tree_pane.cpp.
References _, DisplayErrorMessage(), PROJECT_TREE::GetGitRepo(), KICAD_MANAGER_FRAME::GetProjectFileName(), IsOK(), m_Parent, m_TreeProject, RmDirRecursive(), and PROJECT_TREE::SetGitRepo().
|
private |
Resolve conflicts in the git repository.
Definition at line 2649 of file project_tree_pane.cpp.
References PROJECT_TREE::GetGitRepo(), m_TreeProject, and GIT_RESOLVE_CONFLICT_HANDLER::PerformResolveConflict().
|
private |
Revert the local repository to the last commit.
Definition at line 2661 of file project_tree_pane.cpp.
References PROJECT_TREE::GetGitRepo(), m_TreeProject, and GIT_REVERT_HANDLER::PerformRevert().
|
private |
Definition at line 2741 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 1839 of file project_tree_pane.cpp.
References _, DisplayError(), DIALOG_GIT_SWITCH::GetBranchName(), KIGIT_COMMON::GetBranchNames(), PROJECT_TREE::GetGitRepo(), KIGIT_COMMON::GetLastGitError(), git_create_branch(), PROJECT_TREE::GitCommon(), ID_GIT_SWITCH_BRANCH, m_TreeProject, and DIALOG_SHIM::ShowModal().
|
private |
Sync the current project with the git repository.
Definition at line 2619 of file project_tree_pane.cpp.
References PROJECT_TREE::GetGitRepo(), m_TreeProject, GIT_SYNC_HANDLER::PerformSync(), and traceGit.
|
private |
Definition at line 2691 of file project_tree_pane.cpp.
References COMMON_SETTINGS::GIT::enableGit, PGM_BASE::GetCommonSettings(), GetKiCadThreadPool(), PROJECT_TREE::GitCommon(), gitStatusTimerHandler(), COMMON_SETTINGS::m_Git, m_gitSyncTimer, m_TreeProject, GIT_PULL_HANDLER::PerformFetch(), Pgm(), tp, 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 1137 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::Activate(), FileWatcherReset(), m_selectedItem, and m_watcherNeedReset.
|
private |
Function onOpenDirectory Handles the right-click menu for opening a directory in the current system file browser.
Definition at line 265 of file project_tree_pane.cpp.
References PATHS::GetDefaultUserProjectsPath(), KICAD_MANAGER_FRAME::GetProjectFileName(), GetSelectedData(), LaunchExternal(), and m_Parent.
|
private |
Function onOpenSelectedFileWithTextEditor Call the text editor to open the selected file in the tree project.
Definition at line 1061 of file project_tree_pane.cpp.
References _, ExecuteFile(), GetSelectedData(), PGM_BASE::GetTextEditor(), and Pgm().
|
private |
We don't have uniform borders so we have to draw them ourselves.
Definition at line 1603 of file project_tree_pane.cpp.
|
private |
Function onRenameFile Rename the selected file or directory in the tree project.
Definition at line 1094 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 770 of file project_tree_pane.cpp.
References _, KIUI::AddMenuItem(), COMMON_SETTINGS::GIT::enableGit, KIGIT_COMMON::GetBranchNames(), PGM_BASE::GetCommonSettings(), PROJECT_TREE::GetGitRepo(), KIGIT_COMMON::GetGitRootDirectory(), GetSelectedData(), PROJECT_TREE::GitCommon(), hasChangedFiles(), KIGIT_COMMON::HasLocalCommits(), KIGIT_COMMON::HasPushAndPullRemote(), ID_GIT_COMMIT_FILE, ID_GIT_COMMIT_PROJECT, ID_GIT_INITIALIZE_PROJECT, ID_GIT_PULL, ID_GIT_PUSH, ID_GIT_REMOVE_VCS, ID_GIT_SWITCH_BRANCH, ID_JOBS_RUN, ID_PROJECT_DELETE, ID_PROJECT_NEWDIR, ID_PROJECT_OPEN_DIR, ID_PROJECT_RENAME, ID_PROJECT_SWITCH_TO_OTHER, ID_PROJECT_TXTEDIT, KI_FALLTHROUGH, KiBitmap(), COMMON_SETTINGS::m_Git, m_TreeProject, Pgm(), Prj(), and text.
|
private |
Run a selected jobs file.
Definition at line 2685 of file project_tree_pane.cpp.
|
private |
Called on a double click on an item.
Definition at line 1123 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 252 of file project_tree_pane.cpp.
References GetSelectedData(), KICAD_MANAGER_FRAME::LoadProject(), and m_Parent.
|
private |
Definition at line 1593 of file project_tree_pane.cpp.
References GetBitmapStore(), PROJECT_TREE::LoadIcons(), 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 619 of file project_tree_pane.cpp.
References addItemToProjectTree(), get_git_repository_for_file(), PATHS::GetDefaultUserProjectsPath(), PROJECT_TREE::GetGitRepo(), GetKiCadThreadPool(), KICAD_MANAGER_FRAME::GetProjectFileName(), getProjects(), PROJECT_TREE::GitCommon(), 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, PROJECT_TREE::SetGitRepo(), KIGIT_COMMON::SetSSHKey(), KIGIT_COMMON::SetUsername(), tp, traceGit, and KIGIT_COMMON::UpdateCurrentBranchInfo().
Referenced by KICAD_MANAGER_FRAME::CommonSettingsChanged(), KICAD_MANAGER_FRAME::LoadProject(), KICAD_MANAGER_FRAME::ReCreateTreePrj(), and KICAD_MANAGER_FRAME::RefreshProjectTree().
|
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 240 of file project_tree_pane.cpp.
References m_watcher.
Referenced by EmptyTreePrj(), and ~PROJECT_TREE_PANE().
|
private |
This is a threaded call that will change the map of git status icons for use in the main thread.
Definition at line 2078 of file project_tree_pane.cpp.
References ADVANCED_CFG::GetCfg(), KIGIT_COMMON::GetDifferentFiles(), PROJECT_TREE_ITEM::GetFileName(), PROJECT_TREE::GetGitRepo(), GetItemIdData(), KIGIT_COMMON::GetLastGitError(), KICAD_MANAGER_FRAME::GetProjectFileName(), KIGIT_COMMON::GIT_STATUS_ADDED, KIGIT_COMMON::GIT_STATUS_AHEAD, KIGIT_COMMON::GIT_STATUS_BEHIND, KIGIT_COMMON::GIT_STATUS_CURRENT, KIGIT_COMMON::GIT_STATUS_DELETED, KIGIT_COMMON::GIT_STATUS_IGNORED, KIGIT_COMMON::GIT_STATUS_MODIFIED, PROJECT_TREE::GitCommon(), KIPLATFORM::ENV::IsNetworkPath(), m_gitCurrentBranchName, ADVANCED_CFG::m_GitIconRefreshInterval, m_gitIconsInitialized, m_gitLastError, m_gitStatusIcons, m_gitStatusMutex, m_gitStatusTimer, m_gitTreeCache, m_gitTreeCacheMutex, m_Parent, m_TreeProject, path, Pgm(), refresh, traceGit, and updateGitStatusIcons().
Referenced by gitStatusTimerHandler().
|
private |
Updates the icons shown in the tree project to reflect the current git status.
Definition at line 1967 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(), 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 2025 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::GetFileName(), GetItemIdData(), m_gitTreeCache, m_gitTreeCacheMutex, m_TreeProject, and traceGit.
Referenced by gitStatusTimerHandler().
|
friend |
Definition at line 56 of file project_tree_pane.h.
Referenced by addItemToProjectTree(), and ReCreateTreePrj().
|
private |
Definition at line 315 of file project_tree_pane.h.
Referenced by addItemToProjectTree().
|
private |
Definition at line 322 of file project_tree_pane.h.
Referenced by updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 330 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 321 of file project_tree_pane.h.
Referenced by onGitInitializeProject(), and updateGitStatusIconMap().
|
private |
Definition at line 329 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 328 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 324 of file project_tree_pane.h.
Referenced by onFileSystemEvent(), onGitCommit(), onGitFetch(), onGitPullProject(), onGitPushProject(), ReCreateTreePrj(), updateGitStatusIconMap(), updateGitStatusIcons(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 323 of file project_tree_pane.h.
Referenced by onGitSyncTimer(), ReCreateTreePrj(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 327 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateTreeCache().
|
private |
Definition at line 326 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateTreeCache().
|
private |
Definition at line 313 of file project_tree_pane.h.
Referenced by onFileSystemEvent(), and onRenameFile().
KICAD_MANAGER_FRAME* PROJECT_TREE_PANE::m_Parent |
Definition at line 309 of file project_tree_pane.h.
Referenced by PROJECT_TREE_ITEM::Activate(), addItemToProjectTree(), FileWatcherReset(), findSubdirTreeItem(), onCreateNewDirectory(), onGitRemoveVCS(), onOpenDirectory(), onSwitchToSelectedProject(), ReCreateTreePrj(), and updateGitStatusIconMap().
|
private |
Definition at line 314 of file project_tree_pane.h.
Referenced by findSubdirTreeItem(), and ReCreateTreePrj().
|
private |
Definition at line 317 of file project_tree_pane.h.
Referenced by onIdle(), and onSelect().
PROJECT_TREE* PROJECT_TREE_PANE::m_TreeProject |
Definition at line 310 of file project_tree_pane.h.
Referenced by PROJECT_TREE_ITEM::Activate(), addItemToProjectTree(), canFileBeAddedToVCS(), EmptyTreePrj(), findSubdirTreeItem(), GetItemIdData(), GetSelectedData(), hasChangedFiles(), KICAD_MANAGER_CONTROL::NewFromRepository(), onExpand(), onFileSystemEvent(), onGitCommit(), onGitFetch(), onGitInitializeProject(), onGitPullProject(), onGitPushProject(), onGitRemoveFromIndex(), onGitRemoveVCS(), onGitResolveConflict(), onGitRevertLocal(), onGitStatusTimer(), onGitSwitchBranch(), onGitSyncProject(), onGitSyncTimer(), onRenameFile(), onRight(), onThemeChanged(), ReCreateTreePrj(), updateGitStatusIconMap(), updateGitStatusIcons(), and updateTreeCache().
|
private |
Definition at line 316 of file project_tree_pane.h.
Referenced by FileWatcherReset(), onFileSystemEvent(), and shutdownFileWatcher().
|
private |
Definition at line 318 of file project_tree_pane.h.
Referenced by addItemToProjectTree(), FileWatcherReset(), onExpand(), and onIdle().