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{
51 KICAD_SETTINGS* cfg = mgr.GetAppSettings<KICAD_SETTINGS>( "kicad" );
52
53 wxCHECK( cfg, false );
54
55 m_cbKicadUpdate->SetValue( cfg->m_KiCadUpdateCheck );
56 m_cbPcmUpdate->SetValue( cfg->m_PcmUpdateCheck );
57 m_libAutoAdd->SetValue( cfg->m_PcmLibAutoAdd );
58 m_libAutoRemove->SetValue( cfg->m_PcmLibAutoRemove );
59 m_libPrefix->SetValue( cfg->m_PcmLibPrefix );
60
61 return true;
62}
63
64
66{
68 KICAD_SETTINGS* cfg = mgr.GetAppSettings<KICAD_SETTINGS>( "kicad" );
69
70 wxCHECK( cfg, false );
71
72 cfg->m_KiCadUpdateCheck = m_cbKicadUpdate->GetValue();
73 cfg->m_PcmUpdateCheck = m_cbPcmUpdate->GetValue();
74 cfg->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
75 cfg->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
76 cfg->m_PcmLibPrefix = m_libPrefix->GetValue();
77
78 return true;
79}
wxString m_PcmLibPrefix
Class PANEL_PACKAGES_AND_UPDATES_BASE.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
const int minSize
Push and Shove router track width and via size dialog.
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
Functions to provide common constants and other functions to assist in making a consistent UI.