KiCad PCB EDA Suite
Loading...
Searching...
No Matches
app_settings.cpp
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-2023 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
22#include <common.h>
23#include <eda_units.h>
24#include <layer_ids.h>
25#include <pgm_base.h>
31#include <settings/parameters.h>
32
33
34APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion ) :
35 JSON_SETTINGS( aFilename, SETTINGS_LOC::USER, aSchemaVersion ),
36 m_CrossProbing(),
37 m_FindReplace(),
38 m_Graphics(),
39 m_ColorPicker(),
40 m_LibTree(),
41 m_Printing(),
42 m_System(),
43 m_Window(),
44 m_appSettingsSchemaVersion( aSchemaVersion )
45{
46 // Make Coverity happy:
48
49 // Build parameters list:
50 m_params.emplace_back(
51 new PARAM<int>( "find_replace.match_mode", &m_FindReplace.match_mode, 0 ) );
52
53 m_params.emplace_back(
54 new PARAM<bool>( "find_replace.match_case", &m_FindReplace.match_case, false ) );
55
56 m_params.emplace_back( new PARAM<bool>( "find_replace.search_and_replace",
58
59 m_params.emplace_back( new PARAM<wxString>( "find_replace.find_string",
60 &m_FindReplace.find_string, wxS( "" ) ) );
61
62 m_params.emplace_back( new PARAM_LIST<wxString>( "find_replace.find_history",
64
65 m_params.emplace_back( new PARAM<wxString>( "find_replace.replace_string",
67
68 m_params.emplace_back( new PARAM_LIST<wxString>( "find_replace.replace_history",
70
71 m_params.emplace_back( new PARAM<int>( "graphics.canvas_type",
73
74 m_params.emplace_back( new PARAM<float>( "graphics.highlight_factor",
75 &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) );
76
77 m_params.emplace_back( new PARAM<float>( "graphics.select_factor",
78 &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) );
79
80 m_params.emplace_back( new PARAM<int>( "color_picker.default_tab",
82
83 m_params.emplace_back( new PARAM_LIST<wxString>( "lib_tree.columns", &m_LibTree.columns, {} ) );
84
85 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "lib_tree.column_widths",
86 [&]() -> nlohmann::json
87 {
88 nlohmann::json ret = {};
89
90 for( const std::pair<const wxString, int>& pair : m_LibTree.column_widths )
91 ret[std::string( pair.first.ToUTF8() )] = pair.second;
92
93 return ret;
94 },
95 [&]( const nlohmann::json& aJson )
96 {
97 if( !aJson.is_object() )
98 return;
99
100 m_LibTree.column_widths.clear();
101
102 for( const auto& entry : aJson.items() )
103 {
104 if( !entry.value().is_number_integer() )
105 continue;
106
107 m_LibTree.column_widths[ entry.key() ] = entry.value().get<int>();
108 }
109 },
110 {} ) );
111
112 m_params.emplace_back(
113 new PARAM_LIST<wxString>( "lib_tree.open_libs", &m_LibTree.open_libs, {} ) );
114
115 m_params.emplace_back( new PARAM<bool>( "printing.background",
116 &m_Printing.background, false ) );
117
118 m_params.emplace_back( new PARAM<bool>( "printing.monochrome",
119 &m_Printing.monochrome, true ) );
120
121 m_params.emplace_back( new PARAM<double>( "printing.scale",
122 &m_Printing.scale, 1.0 ) );
123
124 m_params.emplace_back( new PARAM<bool>( "printing.use_theme",
125 &m_Printing.use_theme, false ) );
126
127 m_params.emplace_back( new PARAM<wxString>( "printing.color_theme",
128 &m_Printing.color_theme, wxS( "" ) ) );
129
130 m_params.emplace_back( new PARAM<bool>( "printing.title_block",
131 &m_Printing.title_block, false ) );
132
133 m_params.emplace_back( new PARAM_LIST<int>( "printing.layers",
134 &m_Printing.layers, {} ) );
135
136 m_params.emplace_back( new PARAM<bool>( "system.first_run_shown",
137 &m_System.first_run_shown, false ) ); //@todo RFB remove? - not used
138
139 m_params.emplace_back( new PARAM<int>( "system.max_undo_items",
140 &m_System.max_undo_items, 0 ) );
141
142 m_params.emplace_back( new PARAM_LIST<wxString>( "system.file_history",
143 &m_System.file_history, {} ) );
144
145 if( m_filename == wxS( "pl_editor" )
146 || ( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) ) )
147 {
148 m_params.emplace_back( new PARAM<int>( "system.units",
149 &m_System.units, static_cast<int>( EDA_UNITS::MILS ) ) );
150 }
151 else
152 {
153 m_params.emplace_back( new PARAM<int>( "system.units",
154 &m_System.units, static_cast<int>( EDA_UNITS::MILLIMETRES ) ) );
155 }
156
157 m_params.emplace_back( new PARAM<int>( "system.last_metric_units",
158 &m_System.last_metric_units, static_cast<int>( EDA_UNITS::MILLIMETRES ) ) );
159
160 m_params.emplace_back( new PARAM<int>( "system.last_imperial_units",
161 &m_System.last_imperial_units, static_cast<int>( EDA_UNITS::MILS ) ) );
162
163 m_params.emplace_back( new PARAM<wxString>( "appearance.color_theme",
165
166 addParamsForWindow( &m_Window, "window" );
167
168 m_params.emplace_back( new PARAM<bool>( "cross_probing.on_selection",
169 &m_CrossProbing.on_selection, true ) );
170
171 m_params.emplace_back( new PARAM<bool>( "cross_probing.center_on_items",
173
174 m_params.emplace_back( new PARAM<bool>( "cross_probing.zoom_to_fit",
175 &m_CrossProbing.zoom_to_fit, true ) );
176
177 m_params.emplace_back( new PARAM<bool>( "cross_probing.auto_highlight",
179}
180
181
182bool APP_SETTINGS_BASE::MigrateFromLegacy( wxConfigBase* aCfg )
183{
184 bool ret = true;
185
186 const std::string f = getLegacyFrameName();
187
188 ret &= fromLegacyString( aCfg, "LastFindString", "find_replace.find_string" );
189 ret &= fromLegacyString( aCfg, "LastReplaceString", "find_replace.replace_string" );
190
191 migrateFindReplace( aCfg );
192
193 ret &= fromLegacy<int>( aCfg, "canvas_type", "graphics.canvas_type" );
194
195 ret &= fromLegacy<int>( aCfg, "P22LIB_TREE_MODEL_ADAPTERSelectorColumnWidth",
196 "lib_tree.column_width" );
197
198 ret &= fromLegacy<bool>( aCfg, "PrintMonochrome", "printing.monochrome" );
199 ret &= fromLegacy<double>( aCfg, "PrintScale", "printing.scale" );
200 ret &= fromLegacy<bool>( aCfg, "PrintPageFrame", "printing.title_block" );
201
202 {
203 nlohmann::json js = nlohmann::json::array();
204 wxString key;
205 bool val = false;
206
207 for( unsigned i = 0; i < PCB_LAYER_ID_COUNT; ++i )
208 {
209 key.Printf( wxT( "PlotLayer_%d" ), i );
210
211 if( aCfg->Read( key, &val ) && val )
212 js.push_back( i );
213 }
214
215 Set( "printing.layers", js );
216 }
217
218 ret &= fromLegacy<bool>( aCfg, f + "FirstRunShown", "system.first_run_shown" );
219 ret &= fromLegacy<int>( aCfg, f + "DevelMaxUndoItems", "system.max_undo_items" );
220 ret &= fromLegacy<int>( aCfg, f + "Units", "system.units" );
221
222 {
223 int max_history_size = Pgm().GetCommonSettings()->m_System.file_history_size;
224 wxString file, key;
225 nlohmann::json js = nlohmann::json::array();
226
227 for( int i = 1; i <= max_history_size; i++ )
228 {
229 key.Printf( "file%d", i );
230 file = aCfg->Read( key, wxEmptyString );
231
232 if( !file.IsEmpty() )
233 js.push_back( file.ToStdString() );
234 }
235
236 Set( "system.file_history", js );
237 }
238
239 ret &= migrateWindowConfig( aCfg, f, "window" );
240
241 return ret;
242}
243
244
246{
247 const int find_replace_history_size = 10;
248 nlohmann::json find_history = nlohmann::json::array();
249 nlohmann::json replace_history = nlohmann::json::array();
250 wxString tmp, find_key, replace_key;
251
252 for( int i = 0; i < find_replace_history_size; ++i )
253 {
254 find_key.Printf( "FindStringHistoryList%d", i );
255 replace_key.Printf( "ReplaceStringHistoryList%d", i );
256
257 if( aCfg->Read( find_key, &tmp ) )
258 find_history.push_back( tmp.ToStdString() );
259
260 if( aCfg->Read( replace_key, &tmp ) )
261 replace_history.push_back( tmp.ToStdString() );
262 }
263
264 Set( "find_replace.find_history", find_history );
265 Set( "find_replace.replace_history", replace_history );
266}
267
268
269bool APP_SETTINGS_BASE::migrateWindowConfig( wxConfigBase* aCfg, const std::string& aFrame,
270 const std::string& aJsonPath )
271{
272 bool ret = true;
273
274 const std::string frameGDO = aFrame + "GalDisplayOptions";
275 const std::string cursorPath = aJsonPath + ".cursor";
276 const std::string gridPath = aJsonPath + ".grid";
277
278 ret &= fromLegacy<bool>( aCfg, aFrame + "Maximized", aJsonPath + ".maximized" );
279 ret &= fromLegacyString( aCfg, aFrame + "MostRecentlyUsedPath", aJsonPath + ".mru_path" );
280 ret &= fromLegacy<int>( aCfg, aFrame + "Size_x", aJsonPath + ".size_x" );
281 ret &= fromLegacy<int>( aCfg, aFrame + "Size_y", aJsonPath + ".size_y" );
282 ret &= fromLegacyString( aCfg, aFrame + "Perspective", aJsonPath + ".perspective" );
283 ret &= fromLegacy<int>( aCfg, aFrame + "Pos_x", aJsonPath + ".pos_x" );
284 ret &= fromLegacy<int>( aCfg, aFrame + "Pos_y", aJsonPath + ".pos_y" );
285
286 ret &= fromLegacy<bool>( aCfg, frameGDO + "ForceDisplayCursor", cursorPath + ".always_show_cursor" );
287 ret &= fromLegacy<bool>( aCfg, frameGDO + "CursorFullscreen", cursorPath + ".fullscreen_cursor" );
288
289 ret &= fromLegacy<int>( aCfg, aFrame + "_LastGridSize", gridPath + ".last_size" );
290
291 ret &= fromLegacy<int>( aCfg, aFrame + "FastGrid1", gridPath + ".fast_grid_1" );
292 ret &= fromLegacy<int>( aCfg, aFrame + "FastGrid2", gridPath + ".fast_grid_2" );
293
294 ret &= fromLegacy<bool>( aCfg, frameGDO + "GridAxesEnabled", gridPath + ".axes_enabled" );
295 ret &= fromLegacy<double>( aCfg, frameGDO + "GridLineWidth", gridPath + ".line_width" );
296 ret &= fromLegacy<double>( aCfg, frameGDO + "GridMaxDensity", gridPath + ".min_spacing" );
297 ret &= fromLegacy<bool>( aCfg, frameGDO + "ShowGrid", gridPath + ".show" );
298 ret &= fromLegacy<int>( aCfg, frameGDO + "GridStyle", gridPath + ".style" );
299 ret &= fromLegacyColor( aCfg, frameGDO + "GridColor", gridPath + ".color" );
300
301 return ret;
302}
303
304
305void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std::string& aJsonPath )
306{
307 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".maximized",
308 &aWindow->state.maximized, false ) );
309
310 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".mru_path",
311 &aWindow->mru_path, wxS( "" ) ) );
312
313 m_params.emplace_back( new PARAM<int>( aJsonPath + ".size_x", &aWindow->state.size_x, 0 ) );
314
315 m_params.emplace_back( new PARAM<int>( aJsonPath + ".size_y", &aWindow->state.size_y, 0 ) );
316
317 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".perspective",
318 &aWindow->perspective, wxS( "" ) ) );
319
320 m_params.emplace_back( new PARAM<int>( aJsonPath + ".pos_x", &aWindow->state.pos_x, 0 ) );
321
322 m_params.emplace_back( new PARAM<int>( aJsonPath + ".pos_y", &aWindow->state.pos_y, 0 ) );
323
324 m_params.emplace_back( new PARAM<unsigned int>( aJsonPath + ".display",
325 &aWindow->state.display, 0 ) );
326
327 m_params.emplace_back( new PARAM_LIST<double>( aJsonPath + ".zoom_factors",
328 &aWindow->zoom_factors, {} ) );
329
330 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.axes_enabled",
331 &aWindow->grid.axes_enabled, false ) );
332
333 int defaultGridIdx;
334
335 if( ( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) ) )
336 {
337 defaultGridIdx = 1;
338 }
339 else if( m_filename == wxS( "pl_editor" ) )
340 {
341 defaultGridIdx = 4;
342 }
343 else
344 {
345 defaultGridIdx = 15;
346 }
347
348 m_params.emplace_back( new PARAM_LIST<GRID>( aJsonPath + ".grid.sizes", &aWindow->grid.grids,
350
351 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.last_size",
352 &aWindow->grid.last_size_idx, defaultGridIdx ) );
353
354 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.fast_grid_1",
355 &aWindow->grid.fast_grid_1, defaultGridIdx ) );
356
357 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.fast_grid_2",
358 &aWindow->grid.fast_grid_2, defaultGridIdx + 1 ) );
359
360 // legacy values, leave blank by default so we don't convert them
361 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".grid.user_grid_x",
362 &aWindow->grid.user_grid_x, wxEmptyString ) );
363 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".grid.user_grid_y",
364 &aWindow->grid.user_grid_y, wxEmptyString ) );
365
366 // for grid overrides, give just the schematic and symbol editors sane values
367 if( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) )
368 {
369 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.overrides_enabled",
370 &aWindow->grid.overrides_enabled, true ) );
371 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_connected",
372 &aWindow->grid.override_connected, true ) );
373 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_wires",
374 &aWindow->grid.override_wires, true ) );
375 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_vias",
376 &aWindow->grid.override_vias, false ) );
377 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_text",
378 &aWindow->grid.override_text, true ) );
379 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_graphics",
380 &aWindow->grid.override_graphics, false ) );
381
382 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_connected_idx",
383 &aWindow->grid.override_connected_idx, 1 ) );
384 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_wires_idx",
385 &aWindow->grid.override_wires_idx, 1 ) );
386 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_vias_idx",
387 &aWindow->grid.override_vias_idx, 0 ) );
388 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_text_idx",
389 &aWindow->grid.override_text_idx, 3 ) );
390 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_graphics_idx",
391 &aWindow->grid.override_graphics_idx, 2 ) );
392 }
393 else
394 {
395 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.overrides_enabled",
396 &aWindow->grid.overrides_enabled, false ) );
397 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_connected",
398 &aWindow->grid.override_connected, false ) );
399 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_wires",
400 &aWindow->grid.override_wires, false ) );
401 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_vias",
402 &aWindow->grid.override_vias, false ) );
403 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_text",
404 &aWindow->grid.override_text, false ) );
405 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_graphics",
406 &aWindow->grid.override_graphics, false ) );
407
408 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_connected_idx",
409 &aWindow->grid.override_connected_idx, 16 ) );
410 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_text_idx",
411 &aWindow->grid.override_text_idx, 18 ) );
412 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_wires_idx",
413 &aWindow->grid.override_wires_idx, 19 ) );
414 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_vias_idx",
415 &aWindow->grid.override_vias_idx, 18 ) );
416 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_graphics_idx",
417 &aWindow->grid.override_graphics_idx, 15 ) );
418 }
419
420 m_params.emplace_back( new PARAM<double>( aJsonPath + ".grid.line_width",
421 &aWindow->grid.line_width, 1.0 ) );
422
423 m_params.emplace_back( new PARAM<double>( aJsonPath + ".grid.min_spacing",
424 &aWindow->grid.min_spacing, 10 ) );
425
426 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.show",
427 &aWindow->grid.show, true ) );
428
429 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.style",
430 &aWindow->grid.style, 0 ) );
431
432 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.snap",
433 &aWindow->grid.snap, 0 ) );
434
435 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".cursor.always_show_cursor",
436 &aWindow->cursor.always_show_cursor, true ) );
437
438 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".cursor.fullscreen_cursor",
439 &aWindow->cursor.fullscreen_cursor, false ) );
440}
441
442
443const std::vector<GRID> APP_SETTINGS_BASE::DefaultGridSizeList() const
444{
445 if( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) )
446 {
447 return { GRID{ wxEmptyString, wxS( "100 mil" ), wxS( "100 mil" ) },
448 GRID{ wxEmptyString, wxS( "50 mil" ), wxS( "50 mil" ) },
449 GRID{ wxEmptyString, wxS( "25 mil" ), wxS( "25 mil" ) },
450 GRID{ wxEmptyString, wxS( "10 mil" ), wxS( "10 mil" ) } };
451 }
452 else
453 {
454 return { GRID{ wxEmptyString, wxS( "1000 mil" ), wxS( "1000 mil" ) },
455 GRID{ wxEmptyString, wxS( "500 mil" ), wxS( "500 mil" ) },
456 GRID{ wxEmptyString, wxS( "250 mil" ), wxS( "250 mil" ) },
457 GRID{ wxEmptyString, wxS( "200 mil" ), wxS( "200 mil" ) },
458 GRID{ wxEmptyString, wxS( "100 mil" ), wxS( "100 mil" ) },
459 GRID{ wxEmptyString, wxS( "50 mil" ), wxS( "50 mil" ) },
460 GRID{ wxEmptyString, wxS( "25 mil" ), wxS( "25 mil" ) },
461 GRID{ wxEmptyString, wxS( "20 mil" ), wxS( "20 mil" ) },
462 GRID{ wxEmptyString, wxS( "10 mil" ), wxS( "10 mil" ) },
463 GRID{ wxEmptyString, wxS( "5 mil" ), wxS( "5 mil" ) },
464 GRID{ wxEmptyString, wxS( "2 mil" ), wxS( "2 mil" ) },
465 GRID{ wxEmptyString, wxS( "1 mil" ), wxS( "1 mil" ) },
466 GRID{ wxEmptyString, wxS( "5.0 mm" ), wxS( "5.0 mm" ) },
467 GRID{ wxEmptyString, wxS( "2.5 mm" ), wxS( "2.5 mm" ) },
468 GRID{ wxEmptyString, wxS( "1.0 mm" ), wxS( "1.0 mm" ) },
469 GRID{ wxEmptyString, wxS( "0.5 mm" ), wxS( "0.5 mm" ) },
470 GRID{ wxEmptyString, wxS( "0.25 mm" ), wxS( "0.25 mm" ) },
471 GRID{ wxEmptyString, wxS( "0.2 mm" ), wxS( "0.2 mm" ) },
472 GRID{ wxEmptyString, wxS( "0.1 mm" ), wxS( "0.1 mm" ) },
473 GRID{ wxEmptyString, wxS( "0.05 mm" ), wxS( "0.05 mm" ) },
474 GRID{ wxEmptyString, wxS( "0.025 mm" ), wxS( "0.025 mm" ) },
475 GRID{ wxEmptyString, wxS( "0.01 mm" ), wxS( "0.01 mm" ) } };
476 }
477}
478
479
481{
482 // We used to store only the width of the first column, because there were only
483 // two possible columns.
484 if( std::optional<int> optWidth = Get<int>( "lib_tree.column_width" ) )
485 {
486 Set<nlohmann::json>( "lib_tree.column_widths", { { "Item", *optWidth } } );
487 At( "lib_tree" ).erase( "column_width" );
488 }
489
490 return true;
491}
WINDOW_SETTINGS m_Window
Definition: app_settings.h:170
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
FIND_REPLACE m_FindReplace
Definition: app_settings.h:158
bool migrateWindowConfig(wxConfigBase *aCfg, const std::string &aFrameName, const std::string &aJsonPath)
Migrates legacy window settings into the JSON document.
const std::vector< GRID > DefaultGridSizeList() const
void migrateFindReplace(wxConfigBase *aCfg)
! Migrates the find/replace history string lists
COLOR_PICKER m_ColorPicker
Definition: app_settings.h:162
virtual std::string getLegacyFrameName() const
Definition: app_settings.h:180
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:173
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:156
void addParamsForWindow(WINDOW_SETTINGS *aWindow, const std::string &aJsonPath)
Adds parameters for the given window object.
bool migrateLibTreeWidth()
Migrates the library tree width setting from a single column (Item) to multi-column.
static const wxString COLOR_BUILTIN_DEFAULT
@ GAL_TYPE_OPENGL
OpenGL implementation.
bool fromLegacyString(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig string value to a given JSON pointer value.
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
wxString m_filename
The filename (not including path) of this settings file (inicode)
bool fromLegacyColor(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy COLOR4D stored in a wxConfig string to a given JSON pointer value.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:293
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition: pgm_base.cpp:678
The common library.
template KICOMMON_API void JSON_SETTINGS::Set< nlohmann::json >(const std::string &aPath, nlohmann::json aValue)
SETTINGS_LOC
Definition: json_settings.h:54
@ USER
The main config directory (e.g. ~/.config/kicad/)
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1059
see class PGM_BASE
std::vector< wxString > replace_history
Definition: app_settings.h:99
std::vector< wxString > find_history
Definition: app_settings.h:97
float highlight_factor
How much to brighten highlighted objects by.
Definition: app_settings.h:110
float select_factor
How much to brighten selected objects by.
Definition: app_settings.h:111
std::vector< wxString > columns
Ordered list of visible columns in the tree.
Definition: app_settings.h:121
std::map< wxString, int > column_widths
Column widths, keyed by header name.
Definition: app_settings.h:122
std::vector< wxString > open_libs
list of libraries the user has open in the tree
Definition: app_settings.h:123
bool monochrome
Whether or not to print in monochrome.
Definition: app_settings.h:129
bool background
Whether or not to print background color.
Definition: app_settings.h:128
std::vector< int > layers
List of enabled layers for printing.
Definition: app_settings.h:134
wxString color_theme
Color theme to use for printing.
Definition: app_settings.h:132
double scale
Printout scale.
Definition: app_settings.h:130
bool title_block
Whether or not to print title block.
Definition: app_settings.h:133
bool use_theme
If false, display color theme will be used.
Definition: app_settings.h:131
std::vector< wxString > file_history
Definition: app_settings.h:141
bool on_selection
Synchronize the selection for multiple items too.
Definition: app_settings.h:33
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off)
Definition: app_settings.h:35
bool center_on_items
Automatically pan to cross-probed items.
Definition: app_settings.h:34
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Definition: app_settings.h:36
bool always_show_cursor
Definition: app_settings.h:44
bool fullscreen_cursor
Definition: app_settings.h:45
wxString user_grid_x
Definition: grid_settings.h:67
int override_connected_idx
Definition: grid_settings.h:80
double line_width
Definition: grid_settings.h:72
bool overrides_enabled
Definition: grid_settings.h:78
bool override_graphics
Definition: grid_settings.h:87
bool override_connected
Definition: grid_settings.h:79
std::vector< GRID > grids
Definition: grid_settings.h:66
int override_graphics_idx
Definition: grid_settings.h:88
int override_wires_idx
Definition: grid_settings.h:82
wxString user_grid_y
Definition: grid_settings.h:68
double min_spacing
Definition: grid_settings.h:73
Common grid settings, available to every frame.
Definition: grid_settings.h:34
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:74
CURSOR_SETTINGS cursor
Definition: app_settings.h:80
WINDOW_STATE state
Definition: app_settings.h:75
GRID_SETTINGS grid
Definition: app_settings.h:81
wxString mru_path
Definition: app_settings.h:76
std::vector< double > zoom_factors
Definition: app_settings.h:78
wxString perspective
Definition: app_settings.h:77
unsigned int display
Definition: app_settings.h:67