KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_packages_and_updates.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2022 Andrew Lutsenko, anlutsenko at gmail dot com
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
26
27#include <pgm_base.h>
30#include <widgets/ui_common.h>
31
34{
35 wxSize minSize = m_libPrefix->GetMinSize();
36 int minWidth = m_libPrefix->GetTextExtent( wxT( "XXX.XXX" ) ).GetWidth();
37
38 m_libPrefix->SetMinSize( wxSize( minWidth, minSize.GetHeight() ) );
39
40#ifndef KICAD_UPDATE_CHECK
41 m_generalLabel->Hide();
42 m_staticline3->Hide();
43 m_cbKicadUpdate->Hide();
44#endif
45}
46
47
49{
50 if( KICAD_SETTINGS* cfg = GetAppSettings<KICAD_SETTINGS>( "kicad" ) )
51 {
52 m_cbKicadUpdate->SetValue( cfg->m_KiCadUpdateCheck );
53 m_cbPcmUpdate->SetValue( cfg->m_PcmUpdateCheck );
54 m_libAutoAdd->SetValue( cfg->m_PcmLibAutoAdd );
55 m_libAutoRemove->SetValue( cfg->m_PcmLibAutoRemove );
56 m_libPrefix->SetValue( cfg->m_PcmLibPrefix );
57 }
58
59 return true;
60}
61
62
64{
65 if( KICAD_SETTINGS* cfg = GetAppSettings<KICAD_SETTINGS>( "kicad" ) )
66 {
67 cfg->m_KiCadUpdateCheck = m_cbKicadUpdate->GetValue();
68 cfg->m_PcmUpdateCheck = m_cbPcmUpdate->GetValue();
69 cfg->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
70 cfg->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
71 cfg->m_PcmLibPrefix = m_libPrefix->GetValue();
72 }
73
74 return true;
75}
Class PANEL_PACKAGES_AND_UPDATES_BASE.
const int minSize
Push and Shove router track width and via size dialog.
see class PGM_BASE
Functions to provide common constants and other functions to assist in making a consistent UI.