2022-08-18 20:41:43 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2023-11-22 20:03:34 -05:00
|
|
|
* Copyright (C) 2023 Mark Roszko <mark.roszko@gmail.com>
|
2025-01-01 13:30:11 -08:00
|
|
|
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
2022-08-18 20:41:43 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2023-11-22 20:03:34 -05:00
|
|
|
#include <dialogs/dialog_update_check_prompt.h>
|
2022-08-18 20:41:43 +00:00
|
|
|
#include <settings/settings_manager.h>
|
2023-11-22 20:03:34 -05:00
|
|
|
#include <settings/kicad_settings.h>
|
|
|
|
#include <pgm_base.h>
|
2022-08-18 20:41:43 +00:00
|
|
|
|
2023-11-22 20:03:34 -05:00
|
|
|
DIALOG_UPDATE_CHECK_PROMPT::DIALOG_UPDATE_CHECK_PROMPT( wxWindow* aWindow ) :
|
|
|
|
DIALOG_UPDATE_CHECK_PROMPT_BASE( aWindow )
|
2022-08-18 20:41:43 +00:00
|
|
|
{
|
2024-01-03 19:32:05 -05:00
|
|
|
#ifndef KICAD_UPDATE_CHECK
|
|
|
|
m_cbKiCadUpdates->Hide();
|
|
|
|
#endif
|
2025-01-07 14:17:33 +05:00
|
|
|
|
|
|
|
m_sdbSizerOK->SetFocus();
|
2022-08-18 20:41:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-11-22 20:03:34 -05:00
|
|
|
bool DIALOG_UPDATE_CHECK_PROMPT::TransferDataFromWindow()
|
2022-08-18 20:41:43 +00:00
|
|
|
{
|
2025-06-14 19:35:35 +01:00
|
|
|
if( KICAD_SETTINGS* settings = GetAppSettings<KICAD_SETTINGS>( "kicad" ) )
|
|
|
|
{
|
|
|
|
settings->m_PcmUpdateCheck = m_cbPCMUpdates->GetValue();
|
2024-01-03 19:32:05 -05:00
|
|
|
#ifndef KICAD_UPDATE_CHECK
|
2025-06-14 19:35:35 +01:00
|
|
|
settings->m_KiCadUpdateCheck = m_cbKiCadUpdates->GetValue();
|
2024-01-03 19:32:05 -05:00
|
|
|
#endif
|
2025-06-14 19:35:35 +01:00
|
|
|
}
|
2022-08-18 20:41:43 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-11-22 20:03:34 -05:00
|
|
|
bool DIALOG_UPDATE_CHECK_PROMPT::TransferDataToWindow()
|
2022-08-18 20:41:43 +00:00
|
|
|
{
|
2023-11-22 20:03:34 -05:00
|
|
|
// Since this is a first time start dialog, just default to both checks true
|
|
|
|
m_cbPCMUpdates->SetValue( true );
|
|
|
|
m_cbKiCadUpdates->SetValue( true );
|
2022-08-18 20:41:43 +00:00
|
|
|
|
|
|
|
return true;
|
2023-11-22 20:03:34 -05:00
|
|
|
}
|