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 (C) 2019 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
25#include <bin_mod.h>
26#include <pgm_base.h>
29
30
31BIN_MOD::BIN_MOD( const char* aName ) :
32 m_name( aName ),
33 m_config( nullptr )
34{
35}
36
37
39{
40 // Prepare On Line Help. Use only lower case for help file names, in order to
41 // avoid problems with upper/lower case file names under windows and unix.
42 // Help files are now using html format.
43 // Old help files used pdf format.
44 // so when searching a help file, the .html file will be searched,
45 // and if not found, the .pdf file will be searched.
46 m_help_file = wxString::FromUTF8( m_name ); // no ext given. can be .html or .pdf
47}
48
49
51{
52 if( m_config )
53 {
54 // The settings manager will outlive this module so we need to clean up the module level
55 // settings here instead of leaving it up to the manager
57 m_config = nullptr;
58 }
59}
60
61
63{
64}
65
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
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.
Definition: pgm_base.cpp:1060
see class PGM_BASE
~BIN_MOD()
Definition: bin_mod.cpp:62
void End()
Definition: bin_mod.cpp:50
APP_SETTINGS_BASE * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:57
void Init()
Definition: bin_mod.cpp:38
wxString m_help_file
Definition: bin_mod.h:58
const char * m_name
name of this binary module, static C string.
Definition: bin_mod.h:55
BIN_MOD(const char *aName)
Definition: bin_mod.cpp:31