diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a9d115436..cc673168bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,11 @@ else() set( UNIX_NOT_APPLE OFF ) endif() +if( APPLE OR WIN32 ) + set( APPLE_OR_WIN32 ON ) +else() + set( APPLE_OR_WIN32 OFF ) +endif() # # KiCad build options should be added below. @@ -101,6 +106,11 @@ option( KICAD_SCRIPTING_WXPYTHON ON ) mark_as_advanced( KICAD_SCRIPTING_WXPYTHON ) +cmake_dependent_option( KICAD_UPDATE_CHECK + "Build in update check" + ON "APPLE_OR_WIN32" + OFF ) + # EGL is only needed on Linux with Wayland cmake_dependent_option( KICAD_USE_EGL "Build KiCad with EGL backend support for Wayland." @@ -252,6 +262,7 @@ add_compile_definitions( $<$:KICAD_SIGNAL_INTEGR add_compile_definitions( $<$:KICAD_USE_VALGRIND> ) add_compile_definitions( $<$:KICAD_GAL_PROFILE> ) add_compile_definitions( $<$:KICAD_WIN32_VERIFY_CODESIGN> ) +add_compile_definitions( $<$:KICAD_UPDATE_CHECK> ) if( KICAD_USE_EGL ) message( STATUS "Configuring KiCad for the wxGLCanvas EGL backend" ) diff --git a/common/dialogs/panel_packages_and_updates.cpp b/common/dialogs/panel_packages_and_updates.cpp index 0bf2062f7f..1b0bd6d95d 100644 --- a/common/dialogs/panel_packages_and_updates.cpp +++ b/common/dialogs/panel_packages_and_updates.cpp @@ -36,6 +36,12 @@ PANEL_PACKAGES_AND_UPDATES::PANEL_PACKAGES_AND_UPDATES( wxWindow* parent ) : int minWidth = m_libPrefix->GetTextExtent( wxT( "XXX.XXX" ) ).GetWidth(); m_libPrefix->SetMinSize( wxSize( minWidth, minSize.GetHeight() ) ); + +#ifndef KICAD_UPDATE_CHECK + m_generalLabel->Hide(); + m_staticline3->Hide(); + m_cbKicadUpdate->Hide(); +#endif } @@ -44,7 +50,9 @@ bool PANEL_PACKAGES_AND_UPDATES::TransferDataToWindow() SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); KICAD_SETTINGS* settings = mgr.GetAppSettings(); +#ifndef KICAD_UPDATE_CHECK m_cbKicadUpdate->SetValue( settings->m_KiCadUpdateCheck ); +#endif m_cbPcmUpdate->SetValue( settings->m_PcmUpdateCheck ); m_libAutoAdd->SetValue( settings->m_PcmLibAutoAdd ); m_libAutoRemove->SetValue( settings->m_PcmLibAutoRemove ); diff --git a/kicad/dialogs/dialog_update_check_prompt.cpp b/kicad/dialogs/dialog_update_check_prompt.cpp index 78c288cebf..d7c0632913 100644 --- a/kicad/dialogs/dialog_update_check_prompt.cpp +++ b/kicad/dialogs/dialog_update_check_prompt.cpp @@ -30,6 +30,9 @@ DIALOG_UPDATE_CHECK_PROMPT::DIALOG_UPDATE_CHECK_PROMPT( wxWindow* aWindow ) : DIALOG_UPDATE_CHECK_PROMPT_BASE( aWindow ) { +#ifndef KICAD_UPDATE_CHECK + m_cbKiCadUpdates->Hide(); +#endif } @@ -39,7 +42,9 @@ bool DIALOG_UPDATE_CHECK_PROMPT::TransferDataFromWindow() KICAD_SETTINGS* settings = mgr.GetAppSettings(); settings->m_PcmUpdateCheck = m_cbPCMUpdates->GetValue(); +#ifndef KICAD_UPDATE_CHECK settings->m_KiCadUpdateCheck = m_cbKiCadUpdates->GetValue(); +#endif return true; } diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 60c97f5944..b69a2d62bd 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -963,11 +963,13 @@ void KICAD_MANAGER_FRAME::OnIdle( wxIdleEvent& aEvent ) m_pcm->RunBackgroundUpdate(); } +#ifdef KICAD_UPDATE_CHECK if( !m_updateManager && settings->m_KiCadUpdateCheck ) { m_updateManager = std::make_unique(); m_updateManager->CheckForUpdate( this ); } +#endif }