Move git fully behind advanced config

This commit is contained in:
Seth Hillbrand 2024-02-19 17:19:44 -08:00
parent 421b95d1fa
commit 3ad0abae3f
2 changed files with 20 additions and 12 deletions

View File

@ -24,6 +24,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <advanced_config.h>
#include <bitmaps.h> #include <bitmaps.h>
#include <file_history.h> #include <file_history.h>
#include <kiplatform/policy.h> #include <kiplatform/policy.h>
@ -74,7 +75,11 @@ void KICAD_MANAGER_FRAME::doReCreateMenuBar()
fileMenu->Add( KICAD_MANAGER_ACTIONS::newProject ); fileMenu->Add( KICAD_MANAGER_ACTIONS::newProject );
fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromTemplate ); fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromTemplate );
if( ADVANCED_CFG::GetCfg().m_EnableGit )
{
fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromRepository ); fileMenu->Add( KICAD_MANAGER_ACTIONS::newFromRepository );
}
if( wxDir::Exists( PATHS::GetStockDemosPath() ) ) if( wxDir::Exists( PATHS::GetStockDemosPath() ) )
{ {

View File

@ -629,6 +629,8 @@ void PROJECT_TREE_PANE::ReCreateTreePrj()
bool prjOpened = fn.FileExists(); bool prjOpened = fn.FileExists();
// Bind the git repository to the project tree (if it exists) // Bind the git repository to the project tree (if it exists)
if( ADVANCED_CFG::GetCfg().m_EnableGit )
{
m_TreeProject->SetGitRepo( get_git_repository_for_file( fn.GetPath().c_str() ) ); m_TreeProject->SetGitRepo( get_git_repository_for_file( fn.GetPath().c_str() ) );
m_TreeProject->GitCommon()->SetPassword( Prj().GetLocalSettings().m_GitRepoPassword ); m_TreeProject->GitCommon()->SetPassword( Prj().GetLocalSettings().m_GitRepoPassword );
m_TreeProject->GitCommon()->SetUsername( Prj().GetLocalSettings().m_GitRepoUsername ); m_TreeProject->GitCommon()->SetUsername( Prj().GetLocalSettings().m_GitRepoUsername );
@ -642,6 +644,7 @@ void PROJECT_TREE_PANE::ReCreateTreePrj()
m_TreeProject->GitCommon()->SetConnType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH ); m_TreeProject->GitCommon()->SetConnType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH );
else else
m_TreeProject->GitCommon()->SetConnType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL ); m_TreeProject->GitCommon()->SetConnType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL );
}
// We may have opened a legacy project, in which case GetProjectFileName will return the // We may have opened a legacy project, in which case GetProjectFileName will return the
// name of the migrated (new format) file, which may not have been saved to disk yet. // name of the migrated (new format) file, which may not have been saved to disk yet.