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( new PARAM<bool>( "printing.background",
113 &m_Printing.background, false ) );
114
115 m_params.emplace_back( new PARAM<bool>( "printing.monochrome",
116 &m_Printing.monochrome, true ) );
117
118 m_params.emplace_back( new PARAM<double>( "printing.scale",
119 &m_Printing.scale, 1.0 ) );
120
121 m_params.emplace_back( new PARAM<bool>( "printing.use_theme",
122 &m_Printing.use_theme, false ) );
123
124 m_params.emplace_back( new PARAM<wxString>( "printing.color_theme",
125 &m_Printing.color_theme, wxS( "" ) ) );
126
127 m_params.emplace_back( new PARAM<bool>( "printing.title_block",
128 &m_Printing.title_block, false ) );
129
130 m_params.emplace_back( new PARAM_LIST<int>( "printing.layers",
131 &m_Printing.layers, {} ) );
132
133 m_params.emplace_back( new PARAM<bool>( "system.first_run_shown",
134 &m_System.first_run_shown, false ) ); //@todo RFB remove? - not used
135
136 m_params.emplace_back( new PARAM<int>( "system.max_undo_items",
137 &m_System.max_undo_items, 0 ) );
138
139 m_params.emplace_back( new PARAM_LIST<wxString>( "system.file_history",
140 &m_System.file_history, {} ) );
141
142 if( m_filename == wxS( "pl_editor" )
143 || ( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) ) )
144 {
145 m_params.emplace_back( new PARAM<int>( "system.units",
146 &m_System.units, static_cast<int>( EDA_UNITS::MILS ) ) );
147 }
148 else
149 {
150 m_params.emplace_back( new PARAM<int>( "system.units",
151 &m_System.units, static_cast<int>( EDA_UNITS::MILLIMETRES ) ) );
152 }
153
154 m_params.emplace_back( new PARAM<int>( "system.last_metric_units",
155 &m_System.last_metric_units, static_cast<int>( EDA_UNITS::MILLIMETRES ) ) );
156
157 m_params.emplace_back( new PARAM<int>( "system.last_imperial_units",
158 &m_System.last_imperial_units, static_cast<int>( EDA_UNITS::MILS ) ) );
159
160 m_params.emplace_back( new PARAM<wxString>( "appearance.color_theme",
162
163 addParamsForWindow( &m_Window, "window" );
164
165 m_params.emplace_back( new PARAM<bool>( "cross_probing.on_selection",
166 &m_CrossProbing.on_selection, true ) );
167
168 m_params.emplace_back( new PARAM<bool>( "cross_probing.center_on_items",
170
171 m_params.emplace_back( new PARAM<bool>( "cross_probing.zoom_to_fit",
172 &m_CrossProbing.zoom_to_fit, true ) );
173
174 m_params.emplace_back( new PARAM<bool>( "cross_probing.auto_highlight",
176}
177
178
179bool APP_SETTINGS_BASE::MigrateFromLegacy( wxConfigBase* aCfg )
180{
181 bool ret = true;
182
183 const std::string f = getLegacyFrameName();
184
185 ret &= fromLegacyString( aCfg, "LastFindString", "find_replace.find_string" );
186 ret &= fromLegacyString( aCfg, "LastReplaceString", "find_replace.replace_string" );
187
188 migrateFindReplace( aCfg );
189
190 ret &= fromLegacy<int>( aCfg, "canvas_type", "graphics.canvas_type" );
191
192 ret &= fromLegacy<int>( aCfg, "P22LIB_TREE_MODEL_ADAPTERSelectorColumnWidth",
193 "lib_tree.column_width" );
194
195 ret &= fromLegacy<bool>( aCfg, "PrintMonochrome", "printing.monochrome" );
196 ret &= fromLegacy<double>( aCfg, "PrintScale", "printing.scale" );
197 ret &= fromLegacy<bool>( aCfg, "PrintPageFrame", "printing.title_block" );
198
199 {
200 nlohmann::json js = nlohmann::json::array();
201 wxString key;
202 bool val = false;
203
204 for( unsigned i = 0; i < PCB_LAYER_ID_COUNT; ++i )
205 {
206 key.Printf( wxT( "PlotLayer_%d" ), i );
207
208 if( aCfg->Read( key, &val ) && val )
209 js.push_back( i );
210 }
211
212 Set( "printing.layers", js );
213 }
214
215 ret &= fromLegacy<bool>( aCfg, f + "FirstRunShown", "system.first_run_shown" );
216 ret &= fromLegacy<int>( aCfg, f + "DevelMaxUndoItems", "system.max_undo_items" );
217 ret &= fromLegacy<int>( aCfg, f + "Units", "system.units" );
218
219 {
220 int max_history_size = Pgm().GetCommonSettings()->m_System.file_history_size;
221 wxString file, key;
222 nlohmann::json js = nlohmann::json::array();
223
224 for( int i = 1; i <= max_history_size; i++ )
225 {
226 key.Printf( "file%d", i );
227 file = aCfg->Read( key, wxEmptyString );
228
229 if( !file.IsEmpty() )
230 js.push_back( file.ToStdString() );
231 }
232
233 Set( "system.file_history", js );
234 }
235
236 ret &= migrateWindowConfig( aCfg, f, "window" );
237
238 return ret;
239}
240
241
243{
244 const int find_replace_history_size = 10;
245 nlohmann::json find_history = nlohmann::json::array();
246 nlohmann::json replace_history = nlohmann::json::array();
247 wxString tmp, find_key, replace_key;
248
249 for( int i = 0; i < find_replace_history_size; ++i )
250 {
251 find_key.Printf( "FindStringHistoryList%d", i );
252 replace_key.Printf( "ReplaceStringHistoryList%d", i );
253
254 if( aCfg->Read( find_key, &tmp ) )
255 find_history.push_back( tmp.ToStdString() );
256
257 if( aCfg->Read( replace_key, &tmp ) )
258 replace_history.push_back( tmp.ToStdString() );
259 }
260
261 Set( "find_replace.find_history", find_history );
262 Set( "find_replace.replace_history", replace_history );
263}
264
265
266bool APP_SETTINGS_BASE::migrateWindowConfig( wxConfigBase* aCfg, const std::string& aFrame,
267 const std::string& aJsonPath )
268{
269 bool ret = true;
270
271 const std::string frameGDO = aFrame + "GalDisplayOptions";
272 const std::string cursorPath = aJsonPath + ".cursor";
273 const std::string gridPath = aJsonPath + ".grid";
274
275 ret &= fromLegacy<bool>( aCfg, aFrame + "Maximized", aJsonPath + ".maximized" );
276 ret &= fromLegacyString( aCfg, aFrame + "MostRecentlyUsedPath", aJsonPath + ".mru_path" );
277 ret &= fromLegacy<int>( aCfg, aFrame + "Size_x", aJsonPath + ".size_x" );
278 ret &= fromLegacy<int>( aCfg, aFrame + "Size_y", aJsonPath + ".size_y" );
279 ret &= fromLegacyString( aCfg, aFrame + "Perspective", aJsonPath + ".perspective" );
280 ret &= fromLegacy<int>( aCfg, aFrame + "Pos_x", aJsonPath + ".pos_x" );
281 ret &= fromLegacy<int>( aCfg, aFrame + "Pos_y", aJsonPath + ".pos_y" );
282
283 ret &= fromLegacy<bool>( aCfg, frameGDO + "ForceDisplayCursor", cursorPath + ".always_show_cursor" );
284 ret &= fromLegacy<bool>( aCfg, frameGDO + "CursorFullscreen", cursorPath + ".fullscreen_cursor" );
285
286 ret &= fromLegacy<int>( aCfg, aFrame + "_LastGridSize", gridPath + ".last_size" );
287
288 ret &= fromLegacy<int>( aCfg, aFrame + "FastGrid1", gridPath + ".fast_grid_1" );
289 ret &= fromLegacy<int>( aCfg, aFrame + "FastGrid2", gridPath + ".fast_grid_2" );
290
291 ret &= fromLegacy<bool>( aCfg, frameGDO + "GridAxesEnabled", gridPath + ".axes_enabled" );
292 ret &= fromLegacy<double>( aCfg, frameGDO + "GridLineWidth", gridPath + ".line_width" );
293 ret &= fromLegacy<double>( aCfg, frameGDO + "GridMaxDensity", gridPath + ".min_spacing" );
294 ret &= fromLegacy<bool>( aCfg, frameGDO + "ShowGrid", gridPath + ".show" );
295 ret &= fromLegacy<int>( aCfg, frameGDO + "GridStyle", gridPath + ".style" );
296 ret &= fromLegacyColor( aCfg, frameGDO + "GridColor", gridPath + ".color" );
297
298 return ret;
299}
300
301
302void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std::string& aJsonPath )
303{
304 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".maximized",
305 &aWindow->state.maximized, false ) );
306
307 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".mru_path",
308 &aWindow->mru_path, wxS( "" ) ) );
309
310 m_params.emplace_back( new PARAM<int>( aJsonPath + ".size_x", &aWindow->state.size_x, 0 ) );
311
312 m_params.emplace_back( new PARAM<int>( aJsonPath + ".size_y", &aWindow->state.size_y, 0 ) );
313
314 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".perspective",
315 &aWindow->perspective, wxS( "" ) ) );
316
317 m_params.emplace_back( new PARAM<int>( aJsonPath + ".pos_x", &aWindow->state.pos_x, 0 ) );
318
319 m_params.emplace_back( new PARAM<int>( aJsonPath + ".pos_y", &aWindow->state.pos_y, 0 ) );
320
321 m_params.emplace_back( new PARAM<unsigned int>( aJsonPath + ".display", &aWindow->state.display, 0 ) );
322
323 m_params.emplace_back( new PARAM_LIST<double>( aJsonPath + ".zoom_factors",
324 &aWindow->zoom_factors, {} ) );
325
326 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.axes_enabled",
327 &aWindow->grid.axes_enabled, false ) );
328
329 int defaultGridIdx;
330
331 if( m_filename == wxS( "pl_editor" )
332 || ( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) ) )
333 {
334 defaultGridIdx = 1;
335 }
336 else
337 {
338 defaultGridIdx = 4;
339 }
340
341 m_params.emplace_back( new PARAM_LIST<GRID>( aJsonPath + ".grid.sizes", &aWindow->grid.grids,
343
344 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.last_size",
345 &aWindow->grid.last_size_idx, defaultGridIdx ) );
346
347 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.fast_grid_1",
348 &aWindow->grid.fast_grid_1, defaultGridIdx ) );
349
350 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.fast_grid_2",
351 &aWindow->grid.fast_grid_2, defaultGridIdx + 1 ) );
352
353 // legacy values, leave blank by default so we don't convert them
354 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".grid.user_grid_x",
355 &aWindow->grid.user_grid_x, wxEmptyString ) );
356 m_params.emplace_back( new PARAM<wxString>( aJsonPath + ".grid.user_grid_y",
357 &aWindow->grid.user_grid_y, wxEmptyString ) );
358
359 // for grid overrides, give just the schematic and symbol editors sane values
360 if( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) )
361 {
362 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.overrides_enabled",
363 &aWindow->grid.overrides_enabled, true ) );
364 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_connected",
365 &aWindow->grid.override_connected, true ) );
366 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_wires",
367 &aWindow->grid.override_wires, true ) );
368 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_vias",
369 &aWindow->grid.override_vias, false ) );
370 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_text",
371 &aWindow->grid.override_text, true ) );
372 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_graphics",
373 &aWindow->grid.override_graphics, false ) );
374
375 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_connected_idx",
376 &aWindow->grid.override_connected_idx, 1 ) );
377 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_wires_idx",
378 &aWindow->grid.override_wires_idx, 1 ) );
379 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_vias_idx",
380 &aWindow->grid.override_vias_idx, 0 ) );
381 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_text_idx",
382 &aWindow->grid.override_text_idx, 3 ) );
383 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_graphics_idx",
384 &aWindow->grid.override_graphics_idx, 2 ) );
385 }
386 else
387 {
388 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.overrides_enabled",
389 &aWindow->grid.overrides_enabled, false ) );
390 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_connected",
391 &aWindow->grid.override_connected, false ) );
392 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_wires",
393 &aWindow->grid.override_wires, false ) );
394 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_vias",
395 &aWindow->grid.override_vias, false ) );
396 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_text",
397 &aWindow->grid.override_text, false ) );
398 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.override_graphics",
399 &aWindow->grid.override_graphics, false ) );
400
401 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_connected_idx",
402 &aWindow->grid.override_connected_idx, 16 ) );
403 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_text_idx",
404 &aWindow->grid.override_text_idx, 18 ) );
405 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_wires_idx",
406 &aWindow->grid.override_wires_idx, 19 ) );
407 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_vias_idx",
408 &aWindow->grid.override_vias_idx, 18 ) );
409 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.override_graphics_idx",
410 &aWindow->grid.override_graphics_idx, 15 ) );
411 }
412
413#ifdef __WXMAC__
414 #define DEFAULT_GRID_THICKNESS 2.0
415#else
416 #define DEFAULT_GRID_THICKNESS 1.0
417#endif
418
419 m_params.emplace_back( new PARAM<double>( aJsonPath + ".grid.line_width",
421
422 m_params.emplace_back( new PARAM<double>( aJsonPath + ".grid.min_spacing",
423 &aWindow->grid.min_spacing, 10 ) );
424
425 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".grid.show",
426 &aWindow->grid.show, true ) );
427
428 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.style",
429 &aWindow->grid.style, 0 ) );
430
431 m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.snap",
432 &aWindow->grid.snap, 0 ) );
433
434 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".cursor.always_show_cursor",
435 &aWindow->cursor.always_show_cursor, true ) );
436
437 m_params.emplace_back( new PARAM<bool>( aJsonPath + ".cursor.fullscreen_cursor",
438 &aWindow->cursor.fullscreen_cursor, false ) );
439}
440
441
442const std::vector<GRID> APP_SETTINGS_BASE::DefaultGridSizeList() const
443{
444 if( m_filename == wxS( "eeschema" ) || m_filename == wxS( "symbol_editor" ) )
445 {
446 return { GRID{ wxEmptyString, wxS( "100 mil" ), wxS( "100 mil" ) },
447 GRID{ wxEmptyString, wxS( "50 mil" ), wxS( "50 mil" ) },
448 GRID{ wxEmptyString, wxS( "25 mil" ), wxS( "25 mil" ) },
449 GRID{ wxEmptyString, wxS( "10 mil" ), wxS( "10 mil" ) } };
450 }
451 else
452 {
453 return { GRID{ wxEmptyString, wxS( "1000 mil" ), wxS( "1000 mil" ) },
454 GRID{ wxEmptyString, wxS( "500 mil" ), wxS( "500 mil" ) },
455 GRID{ wxEmptyString, wxS( "250 mil" ), wxS( "250 mil" ) },
456 GRID{ wxEmptyString, wxS( "200 mil" ), wxS( "200 mil" ) },
457 GRID{ wxEmptyString, wxS( "100 mil" ), wxS( "100 mil" ) },
458 GRID{ wxEmptyString, wxS( "50 mil" ), wxS( "50 mil" ) },
459 GRID{ wxEmptyString, wxS( "25 mil" ), wxS( "25 mil" ) },
460 GRID{ wxEmptyString, wxS( "20 mil" ), wxS( "20 mil" ) },
461 GRID{ wxEmptyString, wxS( "10 mil" ), wxS( "10 mil" ) },
462 GRID{ wxEmptyString, wxS( "5 mil" ), wxS( "5 mil" ) },
463 GRID{ wxEmptyString, wxS( "2 mil" ), wxS( "2 mil" ) },
464 GRID{ wxEmptyString, wxS( "1 mil" ), wxS( "1 mil" ) },
465 GRID{ wxEmptyString, wxS( "5.0 mm" ), wxS( "5.0 mm" ) },
466 GRID{ wxEmptyString, wxS( "2.5 mm" ), wxS( "2.5 mm" ) },
467 GRID{ wxEmptyString, wxS( "1.0 mm" ), wxS( "1.0 mm" ) },
468 GRID{ wxEmptyString, wxS( "0.5 mm" ), wxS( "0.5 mm" ) },
469 GRID{ wxEmptyString, wxS( "0.25 mm" ), wxS( "0.25 mm" ) },
470 GRID{ wxEmptyString, wxS( "0.2 mm" ), wxS( "0.2 mm" ) },
471 GRID{ wxEmptyString, wxS( "0.1 mm" ), wxS( "0.1 mm" ) },
472 GRID{ wxEmptyString, wxS( "0.05 mm" ), wxS( "0.05 mm" ) },
473 GRID{ wxEmptyString, wxS( "0.025 mm" ), wxS( "0.025 mm" ) },
474 GRID{ wxEmptyString, wxS( "0.01 mm" ), wxS( "0.01 mm" ) } };
475 }
476}
477
478
480{
481 // We used to store only the width of the first column, because there were only
482 // two possible columns.
483 if( std::optional<int> optWidth = Get<int>( "lib_tree.column_width" ) )
484 {
485 Set<nlohmann::json>( "lib_tree.column_widths", { { "Item", *optWidth } } );
486 At( "lib_tree" ).erase( "column_width" );
487 }
488
489 return true;
490}
#define DEFAULT_GRID_THICKNESS
WINDOW_SETTINGS m_Window
Definition: app_settings.h:169
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
FIND_REPLACE m_FindReplace
Definition: app_settings.h:157
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:161
virtual std::string getLegacyFrameName() const
Definition: app_settings.h:179
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:172
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:155
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.
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...
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...
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:282
The common library.
template void JSON_SETTINGS::Set< nlohmann::json >(const std::string &aPath, nlohmann::json aValue)
SETTINGS_LOC
Definition: json_settings.h:47
@ USER
The main config directory (e.g. ~/.config/kicad/)
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:138
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:119
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
bool monochrome
Whether or not to print in monochrome.
Definition: app_settings.h:128
bool background
Whether or not to print background color.
Definition: app_settings.h:127
std::vector< int > layers
List of enabled layers for printing.
Definition: app_settings.h:133
wxString color_theme
Color theme to use for printing.
Definition: app_settings.h:131
double scale
Printout scale.
Definition: app_settings.h:129
bool title_block
Whether or not to print title block.
Definition: app_settings.h:132
bool use_theme
If false, display color theme will be used.
Definition: app_settings.h:130
std::vector< wxString > file_history
Definition: app_settings.h:140
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