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#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 {
61 };
62
64 {
65 bool enabled;
70
72 unsigned long long limit_total_size;
73 };
74
76 {
78 };
79
80 struct INPUT
81 {
90
94
98
100
104
107 };
108
109 struct GRAPHICS
110 {
113 };
114
115 struct SESSION
116 {
118 std::vector<wxString> pinned_symbol_libs;
119 std::vector<wxString> pinned_fp_libs;
120 std::vector<wxString> pinned_design_block_libs;
121 };
122
123 struct SYSTEM
124 {
126 wxString text_editor;
129 wxString language;
132 wxString working_dir;
134 };
135
137 {
143 };
144
146 {
150 };
151
153 {
155 };
156
158 {
159 wxString name;
160 wxString path;
161 wxString authType;
162 wxString username;
163 wxString ssh_path;
164 bool active;
166 };
167
168 struct GIT
169 {
170 std::vector<GIT_REPOSITORY> repositories;
174 wxString authorName;
175 wxString authorEmail;
176 };
177
178 struct API
179 {
182 };
183
185
186 virtual ~COMMON_SETTINGS() {}
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
202 {
203 wxString m_Alias; // alias to the base path
204 wxString m_Pathvar; // base path as stored in the config file
205 wxString m_Pathexp; // expanded base path
206 wxString m_Description; // description of the aliased path
207 };
208
209 static bool getLegacy3DHollerith( const std::string& aString, size_t& aIndex,
210 wxString& aResult );
211 bool readLegacy3DResolverCfg( const wxString& aPath,
212 std::vector<LEGACY_3D_SEARCH_PATH>& aSearchPaths );
213
214public:
216
218
220
222
224
226
228
230
232
234
236
238
240 std::map<std::string, std::map<std::string, nlohmann::json>> m_dialogControlValues;
241};
242
243#endif
NETCLASS_PANEL m_NetclassPanel
APPEARANCE m_Appearance
virtual ~COMMON_SETTINGS()
std::map< std::string, std::map< std::string, nlohmann::json > > m_dialogControlValues
Persistent dialog control values.
PACKAGE_MANAGER m_PackageManager
AUTO_BACKUP m_Backup
DO_NOT_SHOW_AGAIN m_DoNotShowAgain
ENVIRONMENT m_Env
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig)
Migrates from wxConfig to JSON-based configuration.
MOUSE_DRAG_ACTION
ICON_THEME
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