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
23#include <memory>
24#include <mouse_drag_action.h>
27
29
30enum class ICON_THEME
31{
35};
36
37
39{
40public:
55
67
69 {
71 };
72
101
111
112 struct GRAPHICS
113 {
116 };
117
118 struct SESSION
119 {
121 std::vector<wxString> pinned_symbol_libs;
122 std::vector<wxString> pinned_fp_libs;
123 std::vector<wxString> pinned_design_block_libs;
124 };
125
139
148
150 {
152 };
153
155 {
156 wxString name;
157 wxString path;
158 wxString authType;
159 wxString username;
160 wxString ssh_path;
161 bool active;
163 };
164
165 struct GIT
166 {
167 std::vector<GIT_REPOSITORY> repositories;
171 wxString authorName;
172 wxString authorEmail;
173 };
174
175 struct API
176 {
179 };
180
182
184
187
188 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
189
193 void InitializeEnvironment();
194
195private:
196 bool migrateSchema0to1();
197 bool migrateSchema1to2();
198 bool migrateSchema2to3();
199 bool migrateSchema3to4();
200 bool migrateSchema4to5();
201
203 {
204 wxString m_Alias; // alias to the base path
205 wxString m_Pathvar; // base path as stored in the config file
206 wxString m_Pathexp; // expanded base path
207 wxString m_Description; // description of the aliased path
208 };
209
210 static bool getLegacy3DHollerith( const std::string& aString, size_t& aIndex,
211 wxString& aResult );
212 bool readLegacy3DResolverCfg( const wxString& aPath,
213 std::vector<LEGACY_3D_SEARCH_PATH>& aSearchPaths );
214
215public:
228
229 std::unique_ptr<COMMON_SETTINGS_INTERNALS> m_csInternals;
230};
COMMON_SETTINGS_INTERNALS & CsInternals()
SPACEMOUSE m_SpaceMouse
std::unique_ptr< COMMON_SETTINGS_INTERNALS > m_csInternals
const COMMON_SETTINGS_INTERNALS & CsInternals() const
APPEARANCE m_Appearance
virtual ~COMMON_SETTINGS()
static bool getLegacy3DHollerith(const std::string &aString, size_t &aIndex, wxString &aResult)
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
ICON_THEME
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
#define KICOMMON_API
Definition kicommon.h:28
MOUSE_DRAG_ACTION
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