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 (C) 2020 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#ifndef _COMMON_SETTINGS_H
22#define _COMMON_SETTINGS_H
23
26
27
29{
30 // WARNING: these are encoded as integers in the file, so don't change their values.
31 DRAG_ANY = -2,
33 SELECT,
34 ZOOM,
35 PAN,
36 NONE
37};
38
39enum class ICON_THEME
40{
41 LIGHT,
42 DARK,
43 AUTO
44};
45
46
48{
49public:
51 {
60 };
61
63 {
64 bool enabled;
69
71 unsigned long long limit_total_size;
72 };
73
75 {
77 };
78
79 struct INPUT
80 {
89
93
97
101
103 };
104
105 struct GRAPHICS
106 {
109 };
110
111 struct SESSION
112 {
114 std::vector<wxString> pinned_symbol_libs;
115 std::vector<wxString> pinned_fp_libs;
116 };
117
118 struct SYSTEM
119 {
121 wxString text_editor;
123 wxString language;
126 wxString working_dir;
128 };
129
131 {
136 };
137
139 {
141 };
142
144 {
146 };
147
149 {
150 wxString name;
151 wxString path;
152 wxString authType;
153 wxString username;
154 wxString ssh_path;
155 bool active;
157 };
158
159 struct GIT
160 {
161 std::vector<GIT_REPOSITORY> repositories;
163 wxString authorName;
164 wxString authorEmail;
165 };
166
168
169 virtual ~COMMON_SETTINGS() {}
170
171 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
172
177
178private:
179 bool migrateSchema0to1();
180 bool migrateSchema1to2();
181 bool migrateSchema2to3();
182
184 {
185 wxString m_Alias; // alias to the base path
186 wxString m_Pathvar; // base path as stored in the config file
187 wxString m_Pathexp; // expanded base path
188 wxString m_Description; // description of the aliased path
189 };
190
191 static bool getLegacy3DHollerith( const std::string& aString, size_t& aIndex,
192 wxString& aResult );
193 bool readLegacy3DResolverCfg( const wxString& aPath, std::vector<LEGACY_3D_SEARCH_PATH>& aSearchPaths );
194
195public:
197
199
201
203
205
207
209
211
213
215
217};
218
219#endif
NETCLASS_PANEL m_NetclassPanel
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
void InitializeEnvironment()
Creates the built-in environment variables and sets their default values.
AUTO_BACKUP m_Backup
DO_NOT_SHOW_AGAIN m_DoNotShowAgain
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
ENVIRONMENT m_Env
MOUSE_DRAG_ACTION
ICON_THEME
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
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
MOUSE_DRAG_ACTION drag_right
MOUSE_DRAG_ACTION drag_middle
MOUSE_DRAG_ACTION drag_left
std::vector< wxString > pinned_fp_libs
std::vector< wxString > pinned_symbol_libs