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 (C) 2022 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{
52
53 m_cbKicadUpdate->SetValue( settings->m_KiCadUpdateCheck );
54 m_cbPcmUpdate->SetValue( settings->m_PcmUpdateCheck );
55 m_libAutoAdd->SetValue( settings->m_PcmLibAutoAdd );
56 m_libAutoRemove->SetValue( settings->m_PcmLibAutoRemove );
57 m_libPrefix->SetValue( settings->m_PcmLibPrefix );
58
59 return true;
60}
61
62
64{
67
68 settings->m_KiCadUpdateCheck = m_cbKicadUpdate->GetValue();
69 settings->m_PcmUpdateCheck = m_cbPcmUpdate->GetValue();
70 settings->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
71 settings->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
72 settings->m_PcmLibPrefix = m_libPrefix->GetValue();
73
74 return true;
75}
wxString m_PcmLibPrefix
Class PANEL_PACKAGES_AND_UPDATES_BASE.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
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:1059
see class PGM_BASE
Functions to provide common constants and other functions to assist in making a consistent UI.