|
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 | onGitRemoteSettings (wxCommandEvent &event) |
| Configure (or change) the default remote on an already-initialized repository. | |
| void | onGitCommit (wxCommandEvent &event) |
| Commit the current project saved changes to the git repository. | |
| void | onGitAmendCommit (wxCommandEvent &event) |
| Amend (rewrite) the last commit on the current branch. | |
| 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 () |
| void | showGitFeedback (const wxString &aText) |
| Show a short message in the project status bar after a git operation. | |
| void | onGitFeedbackTimer (wxTimerEvent &event) |
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 |
| wxString | m_gitCurrentUpstream |
| wxTimer | m_gitSyncTimer |
| wxTimer | m_gitStatusTimer |
| wxTimer | m_gitFeedbackTimer |
| std::future< void > | m_gitSyncTask |
| std::future< void > | m_gitStatusIconTask |
| 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 55 of file project_tree_pane.h.
| PROJECT_TREE_PANE::PROJECT_TREE_PANE | ( | KICAD_MANAGER_FRAME * | parent | ) |
Definition at line 237 of file project_tree_pane.cpp.
References ID_LEFT_FRAME, m_filters, m_gitFeedbackTimer, m_gitIconsInitialized, m_gitLastError, m_gitStatusTimer, m_gitSyncTimer, m_isRenaming, m_Parent, m_selectedItem, m_TreeProject, m_watcher, m_watcherNeedReset, onFileSystemEvent(), onGitFeedbackTimer(), onGitStatusTimer(), onGitSyncTimer(), onThemeChanged(), PROJECT_TREE_PANE(), ReCreateTreePrj(), and s_allowedExtensionsToList.
Referenced by PROJECT_TREE_PANE().
| PROJECT_TREE_PANE::~PROJECT_TREE_PANE | ( | ) |
Definition at line 274 of file project_tree_pane.cpp.
References m_gitFeedbackTimer, m_gitStatusIconTask, m_gitStatusTimer, m_gitSyncTask, m_gitSyncTimer, onFileSystemEvent(), onGitFeedbackTimer(), 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 449 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(), KIPLATFORM::IO::IsFileHidden(), JSON_PROJECT, LEGACY_PROJECT, LEGACY_SCHEMATIC, m_filters, m_Parent, m_TreeProject, m_watcherNeedReset, MAX, path, project, 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().
|
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 3028 of file project_tree_pane.cpp.
References GIT_STATUS_HANDLER::GetFileStatus(), KIGIT_COMMON::GIT_STATUS_UNTRACKED, and m_TreeProject.
| void PROJECT_TREE_PANE::EmptyTreePrj | ( | ) |
Delete all m_TreeProject entries.
Definition at line 1700 of file project_tree_pane.cpp.
References _, GetGitBackend(), KIGIT_COMMON::m_gitActionMutex, m_TreeProject, GIT_BACKEND::OrphanRegistry(), KIGIT_ORPHAN_REGISTRY::Register(), registered, KIGIT::PROJECT_GIT_UTILS::RemoveVCS(), KIGIT_COMMON::SetCancelled(), 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 1513 of file project_tree_pane.cpp.
References _, KIPLATFORM::ENV::IsNetworkPath(), m_Parent, m_watcher, m_watcherNeedReset, KISTATUSBAR::SetEllipsedTextField(), text, TO_UTF8, tracePathsAndFiles, and wxFileSystemWatcher.
Referenced by onIdle().
|
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 1327 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 381 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 |
Function GetItemIdData return the item data corresponding to a wxTreeItemId identifier.
| aId | = the wxTreeItemId identifier. |
Definition at line 1321 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 |
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 1297 of file project_tree_pane.cpp.
References GetItemIdData(), m_TreeProject, PROJECT_TREE_ITEM, and traceGit.
Referenced by onCreateNewDirectory(), onDeleteFile(), onGitCommit(), onOpenDirectory(), onOpenSelectedFileWithTextEditor(), onRenameFile(), onRight(), onSelect(), and onSwitchToSelectedProject().
|
private |
Definition at line 3186 of file project_tree_pane.cpp.
References GetKiCadThreadPool(), KIGIT_COMMON::IsCancelled(), m_gitStatusIconTask, m_TreeProject, tp, updateGitStatusIconMap(), and updateTreeCache().
Referenced by onGitStatusTimer(), and onGitSyncTimer().
|
private |
Returns true if the current project has any uncommitted changes.
Definition at line 806 of file project_tree_pane.cpp.
References GIT_STATUS_HANDLER::HasChangedFiles(), 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 351 of file project_tree_pane.cpp.
References _, addItemToProjectTree(), GetSelectedData(), m_Parent, and PROJECT_TREE_ITEM.
|
private |
Function onDeleteFile Delete the selected file or directory in the tree project.
Definition at line 1147 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 1232 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 1385 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 |
Add a file to the git index.
Definition at line 3022 of file project_tree_pane.cpp.
|
private |
Amend (rewrite) the last commit on the current branch.
Definition at line 2747 of file project_tree_pane.cpp.
References _, GitUserConfig::authorEmail, GitUserConfig::authorName, FILEEXT::BackupFileSuffix, delta, DisplayErrorMessage(), flag, FRAME_PCB_EDITOR, FRAME_SCH, DIALOG_GIT_COMMIT::GetAuthorEmail(), DIALOG_GIT_COMMIT::GetAuthorName(), DIALOG_GIT_COMMIT::GetCommitMessage(), GIT_COMMIT_HANDLER::GetErrorString(), GIT_STATUS_HANDLER::GetFileStatus(), PROJECT::GetProjectPath(), KIGIT::PROJECT_GIT_UTILS::GetRepositoryForFile(), DIALOG_GIT_COMMIT::GetSelectedFiles(), GIT_CONFIG_HANDLER::GetUserConfig(), GIT_STATUS_HANDLER::GetWorkingDirectory(), KIGIT_COMMON::GIT_STATUS_CONFLICTED, KIGIT_COMMON::GIT_STATUS_CURRENT, KIGIT_COMMON::GIT_STATUS_IGNORED, EDA_BASE_FRAME::IsContentModified(), FILEEXT::LockFileExtension, FILEEXT::LockFilePrefix, m_gitStatusTimer, m_Parent, m_TreeProject, MAIL_PCB_SAVE, MAIL_SCH_SAVE, path, GIT_COMMIT_HANDLER::PerformAmend(), Prj(), result, DIALOG_GIT_COMMIT::SetCommitMessage(), DIALOG_SHIM::ShowModal(), Success, and traceGit.
|
private |
Commit the current project saved changes to the git repository.
Definition at line 2536 of file project_tree_pane.cpp.
References _, GitUserConfig::authorEmail, GitUserConfig::authorName, FILEEXT::BackupFileSuffix, DIRECTORY, DisplayErrorMessage(), FRAME_PCB_EDITOR, FRAME_SCH, DIALOG_GIT_COMMIT::GetAuthorEmail(), DIALOG_GIT_COMMIT::GetAuthorName(), DIALOG_GIT_COMMIT::GetCommitMessage(), GIT_COMMIT_HANDLER::GetErrorString(), GIT_STATUS_HANDLER::GetFileStatus(), PROJECT::GetProjectPath(), GetSelectedData(), DIALOG_GIT_COMMIT::GetSelectedFiles(), GIT_CONFIG_HANDLER::GetUserConfig(), GIT_STATUS_HANDLER::GetWorkingDirectory(), KIGIT_COMMON::GIT_STATUS_CONFLICTED, KIGIT_COMMON::GIT_STATUS_CURRENT, KIGIT_COMMON::GIT_STATUS_IGNORED, KIGIT_COMMON::GIT_STATUS_UNTRACKED, ID_GIT_COMMIT_PROJECT, EDA_BASE_FRAME::IsContentModified(), FILEEXT::LockFileExtension, FILEEXT::LockFilePrefix, m_gitStatusTimer, m_Parent, m_TreeProject, MAIL_PCB_SAVE, MAIL_SCH_SAVE, GIT_COMMIT_HANDLER::PerformCommit(), Prj(), PROJECT_TREE_ITEM, FILEEXT::ProjectLocalSettingsFileExtension, result, DIALOG_SHIM::ShowModal(), Success, and traceGit.
|
private |
Compare the current project to a different branch in the git repository.
Definition at line 2024 of file project_tree_pane.cpp.
|
private |
Definition at line 3221 of file project_tree_pane.cpp.
References m_Parent.
Referenced by PROJECT_TREE_PANE(), and ~PROJECT_TREE_PANE().
|
private |
Fetch the latest changes from the git repository.
Definition at line 3067 of file project_tree_pane.cpp.
References _, KIGIT_COMMON::ClearAuthFailure(), KIGIT_COMMON::GetRemoteNameOrDefault(), m_gitStatusTimer, m_TreeProject, GIT_PULL_HANDLER::PerformFetch(), promptForGitCredentials(), showGitFeedback(), and KIGIT_COMMON::WasAuthFailure().
|
private |
Initialize a new git repository in the current project directory.
Definition at line 1868 of file project_tree_pane.cpp.
References _, KIGIT_COMMON::ClearAuthFailure(), KIGIT::PROJECT_GIT_UTILS::ComputeSymlinkPreservingWorkDir(), RemoteConfig::connType, DisplayErrorMessage(), DisplayInfoMessage(), PROJECT_TREE_ITEM::GetDir(), KIGIT_ERRORS::GetErrorString(), GetItemIdData(), PROJECT::GetLocalSettings(), DIALOG_GIT_REPOSITORY::GetPassword(), KIGIT_REPO_MIXIN::GetRepo(), 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, GIT_INIT_HANDLER::InitializeRepository(), GIT_INIT_HANDLER::IsRepository(), m_gitLastError, PROJECT_LOCAL_SETTINGS::m_GitRepoType, PROJECT_LOCAL_SETTINGS::m_GitRepoUsername, PROJECT_LOCAL_SETTINGS::m_GitSSHKey, m_TreeProject, RemoteConfig::password, GIT_PULL_HANDLER::PerformFetch(), PR_NO_ABORT, Prj(), PROJECT_TREE_ITEM, promptForGitCredentials(), result, GIT_PROGRESS::SetProgressReporter(), DIALOG_GIT_REPOSITORY::SetSkipButtonLabel(), GIT_INIT_HANDLER::SetupRemote(), DIALOG_SHIM::ShowModal(), RemoteConfig::sshKey, KIPLATFORM::SECRETS::StoreSecret(), Success, RemoteConfig::url, RemoteConfig::username, and KIGIT_COMMON::WasAuthFailure().
|
private |
Pull the latest changes from the git repository.
Definition at line 2030 of file project_tree_pane.cpp.
References _, KIGIT_COMMON::ClearAuthFailure(), Conflict, DisplayErrorMessage(), FastForward, KIGIT_COMMON::GetCurrentBranchName(), KIGIT_ERRORS::GetErrorString(), KIGIT_COMMON::GetUpstreamShorthand(), m_gitStatusTimer, m_TreeProject, GIT_PULL_HANDLER::PerformPull(), PR_NO_ABORT, promptForGitCredentials(), GIT_PULL_HANDLER::RebaseOntoUpstream(), GIT_PULL_HANDLER::ResetToUpstream(), GIT_PROGRESS::SetProgressReporter(), showGitFeedback(), Success, UpToDate, and KIGIT_COMMON::WasAuthFailure().
|
private |
Push the current project changes to the git repository.
Definition at line 2128 of file project_tree_pane.cpp.
References _, KIGIT_COMMON::ClearAuthFailure(), DisplayErrorMessage(), KIGIT_COMMON::GetCurrentBranchName(), KIGIT_ERRORS::GetErrorString(), KIGIT_COMMON::GetUpstreamShorthand(), m_gitStatusTimer, m_TreeProject, NonFastForward, GIT_PUSH_HANDLER::PerformPush(), PR_NO_ABORT, promptForGitCredentials(), GIT_PROGRESS::SetProgressReporter(), showGitFeedback(), Success, and KIGIT_COMMON::WasAuthFailure().
|
private |
Configure (or change) the default remote on an already-initialized repository.
Definition at line 1967 of file project_tree_pane.cpp.
References _, RemoteConfig::connType, DisplayErrorMessage(), KIGIT_ERRORS::GetErrorString(), PROJECT::GetLocalSettings(), DIALOG_GIT_REPOSITORY::GetPassword(), KIGIT_COMMON::GetRepo(), 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_LOCAL_SETTINGS::m_GitRepoType, PROJECT_LOCAL_SETTINGS::m_GitRepoUsername, PROJECT_LOCAL_SETTINGS::m_GitSSHKey, m_gitStatusTimer, m_TreeProject, RemoteConfig::password, Prj(), GIT_INIT_HANDLER::SetupRemote(), DIALOG_SHIM::ShowModal(), RemoteConfig::sshKey, KIPLATFORM::SECRETS::StoreSecret(), KIGIT_COMMON::UpdateCurrentBranchInfo(), RemoteConfig::url, and RemoteConfig::username.
|
private |
Remove a file from the git index.
Definition at line 3124 of file project_tree_pane.cpp.
References m_TreeProject, and GIT_REMOVE_FROM_INDEX_HANDLER::PerformRemoveFromIndex().
|
private |
Remove the git repository from the current project directory.
Definition at line 2237 of file project_tree_pane.cpp.
References KIGIT::PROJECT_GIT_UTILS::ComputeSymlinkPreservingWorkDir(), PROJECT::GetLocalSettings(), KIGIT::PROJECT_GIT_UTILS::GetRepositoryForFile(), m_gitIconsInitialized, PROJECT_LOCAL_SETTINGS::m_GitIntegrationDisabled, PROJECT_LOCAL_SETTINGS::m_GitRepoUsername, PROJECT_LOCAL_SETTINGS::m_GitSSHKey, m_TreeProject, Prj(), PROJECT_LOCAL_SETTINGS::SaveToFile(), and traceGit.
|
private |
Resolve conflicts in the git repository.
Definition at line 3100 of file project_tree_pane.cpp.
References m_TreeProject, and GIT_RESOLVE_CONFLICT_HANDLER::PerformResolveConflict().
|
private |
Revert the local repository to the last commit.
Definition at line 3112 of file project_tree_pane.cpp.
References m_TreeProject, and GIT_REVERT_HANDLER::PerformRevert().
|
private |
Definition at line 3200 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 2194 of file project_tree_pane.cpp.
References KIGIT::PROJECT_GIT_UTILS::CreateBranch(), DisplayError(), DIALOG_GIT_SWITCH::GetBranchName(), KIGIT_ERRORS::GetErrorString(), ID_GIT_SWITCH_BRANCH, m_gitStatusTimer, m_TreeProject, DIALOG_SHIM::ShowModal(), Success, GIT_BRANCH_HANDLER::SwitchToBranch(), and traceGit.
|
private |
Sync the current project with the git repository.
Definition at line 3051 of file project_tree_pane.cpp.
References m_TreeProject, GIT_SYNC_HANDLER::PerformSync(), and traceGit.
|
private |
Definition at line 3142 of file project_tree_pane.cpp.
References COMMON_SETTINGS::GIT::enableGit, PGM_BASE::GetCommonSettings(), GetKiCadThreadPool(), gitStatusTimerHandler(), KIGIT_COMMON::IsCancelled(), COMMON_SETTINGS::m_Git, m_gitSyncTask, 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 1199 of file project_tree_pane.cpp.
References PROJECT_TREE_ITEM::Activate(), FileWatcherReset(), GetItemIdData(), m_selectedItem, m_TreeProject, m_watcherNeedReset, and PROJECT_TREE_ITEM.
|
private |
Function onOpenDirectory Handles the right-click menu for opening a directory in the current system file browser.
Definition at line 323 of file project_tree_pane.cpp.
References PATHS::GetDefaultUserProjectsPath(), GetSelectedData(), LaunchExternal(), m_Parent, and PROJECT_TREE_ITEM.
|
private |
Function onOpenSelectedFileWithTextEditor Call the text editor to open the selected file in the tree project.
Definition at line 1123 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 1820 of file project_tree_pane.cpp.
|
private |
Function onRenameFile Rename the selected file or directory in the tree project.
Definition at line 1156 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 816 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(), hasChangedFiles(), KIGIT_COMMON::HasLocalCommits(), KIGIT_COMMON::HasPushAndPullRemote(), ID_GIT_AMEND_COMMIT, ID_GIT_COMMIT_FILE, ID_GIT_COMMIT_PROJECT, ID_GIT_INITIALIZE_PROJECT, ID_GIT_PULL, ID_GIT_PUSH, ID_GIT_REMOTE_SETTINGS, 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, GIT_BACKEND::IsLibraryAvailable(), JOBSET_FILE, JSON_PROJECT, KI_FALLTHROUGH, KiBitmap(), LEGACY_PROJECT, COMMON_SETTINGS::m_Git, m_gitCurrentBranchName, m_gitCurrentUpstream, PROJECT_LOCAL_SETTINGS::m_GitIntegrationDisabled, m_TreeProject, open_project, PDF, Pgm(), Prj(), PROJECT_TREE_ITEM, right, SEXPR_PCB, SEXPR_SCHEMATIC, text, trash, and ZIP_ARCHIVE.
|
private |
Run a selected jobs file.
Definition at line 3136 of file project_tree_pane.cpp.
|
private |
Called on a double click on an item.
Definition at line 1185 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 310 of file project_tree_pane.cpp.
References GetSelectedData(), and m_Parent.
|
private |
Definition at line 1810 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 664 of file project_tree_pane.cpp.
References addItemToProjectTree(), KIGIT::PROJECT_GIT_UTILS::ComputeSymlinkPreservingWorkDir(), PATHS::GetDefaultUserProjectsPath(), getProjects(), KIGIT::PROJECT_GIT_UTILS::GetRepositoryForFile(), 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, KIGIT::PROJECT_GIT_UTILS::RemoveVCS(), ROOT, and traceGit.
Referenced by PROJECT_TREE_PANE().
|
private |
Show a short message in the project status bar after a git operation.
Definition at line 3211 of file project_tree_pane.cpp.
References m_gitFeedbackTimer, and m_Parent.
Referenced by onGitFetch(), onGitPullProject(), and onGitPushProject().
|
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 298 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 2421 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, m_gitCurrentUpstream, ADVANCED_CFG::m_GitIconRefreshInterval, m_gitIconsInitialized, m_gitStatusIcons, m_gitStatusMutex, m_gitStatusTimer, m_gitTreeCache, m_gitTreeCacheMutex, m_Parent, m_TreeProject, Pgm(), Prj(), 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 2303 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 2365 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().
|
friend |
Definition at line 57 of file project_tree_pane.h.
References PROJECT_TREE_ITEM.
Referenced by addItemToProjectTree(), findSubdirTreeItem(), GetItemIdData(), GetSelectedData(), onCreateNewDirectory(), onDeleteFile(), onExpand(), onFileSystemEvent(), onGitCommit(), onGitInitializeProject(), onIdle(), onOpenDirectory(), onOpenSelectedFileWithTextEditor(), onRight(), PROJECT_TREE_ITEM, ReCreateTreePrj(), updateGitStatusIcons(), and updateTreeCache().
|
private |
Definition at line 331 of file project_tree_pane.h.
Referenced by addItemToProjectTree(), and PROJECT_TREE_PANE().
|
private |
Definition at line 338 of file project_tree_pane.h.
Referenced by onRight(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 339 of file project_tree_pane.h.
Referenced by onRight(), and updateGitStatusIconMap().
|
private |
Definition at line 342 of file project_tree_pane.h.
Referenced by PROJECT_TREE_PANE(), showGitFeedback(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 350 of file project_tree_pane.h.
Referenced by onGitRemoveVCS(), PROJECT_TREE_PANE(), ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 337 of file project_tree_pane.h.
Referenced by onGitInitializeProject(), and PROJECT_TREE_PANE().
|
private |
Definition at line 349 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 344 of file project_tree_pane.h.
Referenced by gitStatusTimerHandler(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 348 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateGitStatusIcons().
|
private |
Definition at line 341 of file project_tree_pane.h.
Referenced by onFileSystemEvent(), onGitAmendCommit(), onGitCommit(), onGitFetch(), onGitPullProject(), onGitPushProject(), onGitRemoteSettings(), onGitSwitchBranch(), PROJECT_TREE_PANE(), ReCreateTreePrj(), updateGitStatusIconMap(), updateGitStatusIcons(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 343 of file project_tree_pane.h.
Referenced by onGitSyncTimer(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 340 of file project_tree_pane.h.
Referenced by onGitSyncTimer(), PROJECT_TREE_PANE(), ReCreateTreePrj(), and ~PROJECT_TREE_PANE().
|
private |
Definition at line 347 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateTreeCache().
|
private |
Definition at line 346 of file project_tree_pane.h.
Referenced by ReCreateTreePrj(), updateGitStatusIconMap(), and updateTreeCache().
|
private |
Definition at line 329 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 325 of file project_tree_pane.h.
Referenced by PROJECT_TREE_ITEM::Activate(), addItemToProjectTree(), FileWatcherReset(), findSubdirTreeItem(), onCreateNewDirectory(), onGitAmendCommit(), onGitCommit(), onGitFeedbackTimer(), onOpenDirectory(), onSwitchToSelectedProject(), PROJECT_TREE_PANE(), ReCreateTreePrj(), showGitFeedback(), and updateGitStatusIconMap().
|
private |
Definition at line 330 of file project_tree_pane.h.
Referenced by findSubdirTreeItem(), and ReCreateTreePrj().
|
private |
Definition at line 333 of file project_tree_pane.h.
Referenced by onIdle(), onSelect(), and PROJECT_TREE_PANE().
| PROJECT_TREE* PROJECT_TREE_PANE::m_TreeProject |
Definition at line 326 of file project_tree_pane.h.
Referenced by PROJECT_TREE_ITEM::Activate(), addItemToProjectTree(), canFileBeAddedToVCS(), EmptyTreePrj(), findSubdirTreeItem(), GetItemIdData(), GetSelectedData(), gitStatusTimerHandler(), hasChangedFiles(), KICAD_MANAGER_CONTROL::NewFromRepository(), onExpand(), onFileSystemEvent(), onGitAmendCommit(), onGitCommit(), onGitFetch(), onGitInitializeProject(), onGitPullProject(), onGitPushProject(), onGitRemoteSettings(), onGitRemoveFromIndex(), onGitRemoveVCS(), onGitResolveConflict(), onGitRevertLocal(), onGitStatusTimer(), onGitSwitchBranch(), onGitSyncProject(), onGitSyncTimer(), onIdle(), onRenameFile(), onRight(), onThemeChanged(), PROJECT_TREE_PANE(), ReCreateTreePrj(), updateGitStatusIconMap(), updateGitStatusIcons(), and updateTreeCache().
|
private |
Definition at line 332 of file project_tree_pane.h.
Referenced by FileWatcherReset(), onFileSystemEvent(), PROJECT_TREE_PANE(), and shutdownFileWatcher().
|
private |
Definition at line 334 of file project_tree_pane.h.
Referenced by addItemToProjectTree(), FileWatcherReset(), onExpand(), onIdle(), and PROJECT_TREE_PANE().