KiCad PCB EDA Suite
Loading...
Searching...
No Matches
common_settings.h
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) 2020 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
25
26
28{
29 // WARNING: these are encoded as integers in the file, so don't change their values.
36};
37
38enum class ICON_THEME
39{
43};
44
45
47{
48public:
62
74
76 {
78 };
79
108
118
119 struct GRAPHICS
120 {
123 };
124
125 struct SESSION
126 {
128 std::vector<wxString> pinned_symbol_libs;
129 std::vector<wxString> pinned_fp_libs;
130 std::vector<wxString> pinned_design_block_libs;
131 };
132
145
154
161
163 {
165 };
166
168 {
169 wxString name;
170 wxString path;
171 wxString authType;
172 wxString username;
173 wxString ssh_path;
174 bool active;
176 };
177
178 struct GIT
179 {
180 std::vector<GIT_REPOSITORY> repositories;
184 wxString authorName;
185 wxString authorEmail;
186 };
187
188 struct API
189 {
192 };
193
195
196 virtual ~COMMON_SETTINGS() {}
197
198 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
199
203 void InitializeEnvironment();
204
205private:
206 bool migrateSchema0to1();
207 bool migrateSchema1to2();
208 bool migrateSchema2to3();
209 bool migrateSchema3to4();
210
212 {
213 wxString m_Alias; // alias to the base path
214 wxString m_Pathvar; // base path as stored in the config file
215 wxString m_Pathexp; // expanded base path
216 wxString m_Description; // description of the aliased path
217 };
218
219 static bool getLegacy3DHollerith( const std::string& aString, size_t& aIndex,
220 wxString& aResult );
221 bool readLegacy3DResolverCfg( const wxString& aPath,
222 std::vector<LEGACY_3D_SEARCH_PATH>& aSearchPaths );
223
224public:
238
240 std::map<std::string, std::map<std::string, nlohmann::json>> m_dialogControlValues;
241};
NETCLASS_PANEL m_NetclassPanel
SPACEMOUSE m_SpaceMouse
APPEARANCE m_Appearance
virtual ~COMMON_SETTINGS()
static bool getLegacy3DHollerith(const std::string &aString, size_t &aIndex, wxString &aResult)
std::map< std::string, std::map< std::string, nlohmann::json > > m_dialogControlValues
Persistent dialog control values.
bool readLegacy3DResolverCfg(const wxString &aPath, std::vector< LEGACY_3D_SEARCH_PATH > &aSearchPaths)
PACKAGE_MANAGER m_PackageManager
AUTO_BACKUP m_Backup
DO_NOT_SHOW_AGAIN m_DoNotShowAgain
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig)
Migrates from wxConfig to JSON-based configuration.
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
A base light class to derive to implement other light classes.
Definition light.h:41
MOUSE_DRAG_ACTION
ICON_THEME
@ NONE
Definition eda_shape.h:69
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
#define KICOMMON_API
Definition kicommon.h:28
int min_interval
Minimum time, in seconds, between subsequent backups.
bool backup_on_autosave
Trigger a backup on autosave.
unsigned long long limit_total_size
Maximum total size of backups (bytes), 0 for unlimited.
int limit_total_files
Maximum number of backup archives to retain.
int limit_daily_files
Maximum files to keep per day, 0 for unlimited.
bool enabled
Automatically back up the project when files are saved.
std::vector< GIT_REPOSITORY > repositories
int canvas_type
EDA_DRAW_PANEL_GAL::GAL_TYPE_* value, see gal_options_panel.cpp.
MOUSE_DRAG_ACTION drag_right
MOUSE_DRAG_ACTION drag_middle
MOUSE_DRAG_ACTION drag_left
std::vector< wxString > pinned_design_block_libs
std::vector< wxString > pinned_fp_libs
std::vector< wxString > pinned_symbol_libs