KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bin_mod.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) 2014 CERN
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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <bin_mod.h>
22#include <pgm_base.h>
25
26
27BIN_MOD::BIN_MOD( const char* aName ) :
28 m_name( aName ),
29 m_config( nullptr )
30{
31}
32
33
35{
36 // Prepare On Line Help. Use only lower case for help file names, in order to
37 // avoid problems with upper/lower case file names under windows and unix.
38 // Help files are now using html format.
39 // Old help files used pdf format.
40 // so when searching a help file, the .html file will be searched,
41 // and if not found, the .pdf file will be searched.
42 m_help_file = wxString::FromUTF8( m_name ); // no ext given. can be .html or .pdf
43}
44
45
47{
48 if( m_config )
49 {
50 // The settings manager will outlive this module so we need to clean up the module level
51 // settings here instead of leaving it up to the manager
53 m_config = nullptr;
54 }
55}
56
57
61
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:124
void FlushAndRelease(JSON_SETTINGS *aSettings, bool aSave=true)
If the given settings object is registered, save it to disk and unregister it.
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
~BIN_MOD()
Definition bin_mod.cpp:58
void End()
Definition bin_mod.cpp:46
APP_SETTINGS_BASE * m_config
maybe from $HOME/.${m_name}
Definition bin_mod.h:53
void Init()
Definition bin_mod.cpp:34
wxString m_help_file
Definition bin_mod.h:54
const char * m_name
name of this binary module, static C string.
Definition bin_mod.h:51
BIN_MOD(const char *aName)
Definition bin_mod.cpp:27