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
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <memory>
24#include <vector>
25#include <mouse_drag_action.h>
28#include <template_fieldnames.h>
29
31
32enum class ICON_THEME
33{
37};
38
39enum class APP_THEME
40{
44};
45
46enum class BACKUP_FORMAT
47{
49 ZIP = 1
50};
51
53{
56};
57
63
65{
66public:
82
84 {
85 bool enabled;
92
94 unsigned long long limit_total_size;
95
96 constexpr static unsigned long long UNLIMITED_SIZE = 0;
97 };
98
100 {
102 };
103
134
144
145 struct GRAPHICS
146 {
149 };
150
151 struct SESSION
152 {
154 std::vector<wxString> pinned_symbol_libs;
155 std::vector<wxString> pinned_fp_libs;
156 std::vector<wxString> pinned_design_block_libs;
157 };
158
171
181
182 // Sticky "Embed file" choice, remembered per file-picker context.
190
191 // Sticky "Use relative path" choice, remembered per file-picker context.
197
199 {
201 };
202
204 {
205 wxString name;
206 wxString path;
207 wxString authType;
208 wxString username;
209 wxString ssh_path;
210 bool active;
212 };
213
214 struct GIT
215 {
216 std::vector<GIT_REPOSITORY> repositories;
220 wxString authorName;
221 wxString authorEmail;
223 };
224
225 struct API
226 {
229 };
230
232
234
237
238 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
239
243 void InitializeEnvironment();
244
253 {
254 return m_Backup.enabled && m_Backup.format == BACKUP_FORMAT::INCREMENTAL;
255 }
256
257private:
258 bool migrateSchema0to1();
259 bool migrateSchema1to2();
260 bool migrateSchema2to3();
261 bool migrateSchema3to4();
262 bool migrateSchema4to5();
263 bool migrateSchema5to6();
264 bool migrateSchema6to7();
265
267 {
268 wxString m_Alias; // alias to the base path
269 wxString m_Pathvar; // base path as stored in the config file
270 wxString m_Pathexp; // expanded base path
271 wxString m_Description; // description of the aliased path
272 };
273
274 static bool getLegacy3DHollerith( const std::string& aString, size_t& aIndex,
275 wxString& aResult );
276 bool readLegacy3DResolverCfg( const wxString& aPath,
277 std::vector<LEGACY_3D_SEARCH_PATH>& aSearchPaths );
278
279public:
294
297
300 std::vector<wxString> m_Extra3DSearchDirs;
301
304
305 std::unique_ptr<COMMON_SETTINGS_INTERNALS> m_csInternals;
306};
COMMON_SETTINGS_INTERNALS & CsInternals()
bool AutosaveUsesLocalHistory() const
The backup format is the single switch that selects the autosave mechanism: the incremental format re...
std::vector< wxString > m_Extra3DSearchDirs
Extra directories to search for 3D models, added by the user through the 3D model migration dialog.
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)
std::vector< wxString > m_DeclinedModelPreviewRequirements
Preview-component requirements explicitly dismissed by the user.
RELATIVE_PATH_DEFAULTS m_RelativePathDefaults
bool readLegacy3DResolverCfg(const wxString &aPath, std::vector< LEGACY_3D_SEARCH_PATH > &aSearchPaths)
PACKAGE_MANAGER m_PackageManager
EMBED_FILE_DEFAULTS m_EmbedFileDefaults
AUTO_BACKUP m_Backup
TEMPLATES m_FieldNameTemplates
Global field name templates shared by all project editors.
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:37
APP_THEME
ICON_THEME
BACKUP_FORMAT
@ INCREMENTAL
Git-based local history (default)
TOUCHPAD_MODE
BACKUP_LOCATION
@ USER_DIR
Under the KiCad user data directory.
@ PROJECT_DIR
Inside the project directory (default)
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
#define KICOMMON_API
Definition kicommon.h:27
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.
BACKUP_LOCATION location
Where backups, history, and autosave files live.
static constexpr unsigned long long UNLIMITED_SIZE
Value representing unlimited total size.
int limit_daily_files
Maximum files to keep per day, 0 for unlimited.
BACKUP_FORMAT format
Backup format (incremental git history vs zip archives)
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