108 "design_block_chooser.lib_tree.column_widths",
109 [&]() -> nlohmann::json
111 nlohmann::json ret = nlohmann::json::object();
113 for( const auto& [name, width] : m_DesignBlockChooserPanel.tree.column_widths )
114 ret[std::string( name.ToUTF8() )] = width;
118 [&](
const nlohmann::json& aJson )
120 if( !aJson.is_object() )
123 m_DesignBlockChooserPanel.tree.column_widths.clear();
125 for( const auto& entry : aJson.items() )
127 if( !entry.value().is_number_integer() )
130 m_DesignBlockChooserPanel.tree.column_widths[entry.key()] = entry.value().get<int>();
136 m_params.back()->SetClearUnknownKeys();
139 &m_DesignBlockChooserPanel.tree.open_libs, {} ) );
141 m_params.emplace_back(
new PARAM<float>(
"graphics.highlight_factor",
142 &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) );
144 m_params.emplace_back(
new PARAM<float>(
"graphics.select_factor",
145 &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) );
147 m_params.emplace_back(
new PARAM<int>(
"color_picker.default_tab",
148 &m_ColorPicker.default_tab, 0 ) );
151 &m_LibTree.columns, {} ) );
154 [&]() -> nlohmann::json
156 nlohmann::json ret = nlohmann::json::object();
158 for( const std::pair<const wxString, int>& pair : m_LibTree.column_widths )
159 ret[std::string( pair.first.ToUTF8() )] = pair.second;
163 [&](
const nlohmann::json& aJson )
165 if( !aJson.is_object() )
168 m_LibTree.column_widths.clear();
170 for( const auto& entry : aJson.items() )
172 if( !entry.value().is_number_integer() )
175 m_LibTree.column_widths[ entry.key() ] = entry.value().get<int>();
181 m_params.back()->SetClearUnknownKeys();
183 m_params.emplace_back(
186 m_params.emplace_back(
new PARAM<bool>(
"printing.background",
187 &m_Printing.background,
false ) );
189 m_params.emplace_back(
new PARAM<bool>(
"printing.monochrome",
190 &m_Printing.monochrome,
true ) );
193 &m_Printing.scale, 1.0 ) );
195 m_params.emplace_back(
new PARAM<bool>(
"printing.use_theme",
196 &m_Printing.use_theme,
false ) );
199 &m_Printing.color_theme, wxS(
"" ) ) );
201 m_params.emplace_back(
new PARAM<bool>(
"printing.title_block",
202 &m_Printing.title_block,
false ) );
205 &m_Printing.layers, {} ) );
207 m_params.emplace_back(
new PARAM<bool>(
"printing.mirror",
208 &m_Printing.mirror,
false ) );
210 m_params.emplace_back(
new PARAM<int>(
"printing.drill_marks",
211 &m_Printing.drill_marks, 1 ) );
213 m_params.emplace_back(
new PARAM<int>(
"printing.pagination",
214 &m_Printing.pagination, 1 ) );
216 m_params.emplace_back(
new PARAM<bool>(
"printing.edge_cuts_on_all_pages",
217 &m_Printing.edge_cuts_on_all_pages,
true ) );
219 m_params.emplace_back(
new PARAM<bool>(
"printing.as_item_checkboxes",
220 &m_Printing.as_item_checkboxes,
false ) );
222 m_params.emplace_back(
new PARAM<int>(
"search_pane.selection_zoom",
223 reinterpret_cast<int*
>( &m_SearchPane.selection_zoom ),
224 static_cast<int>( SEARCH_PANE::SELECTION_ZOOM::PAN ) ) );
226 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_hidden_fields",
227 &m_SearchPane.search_hidden_fields,
true ) );
229 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_metadata",
230 &m_SearchPane.search_metadata,
false ) );
232 m_params.emplace_back(
new PARAM<bool>(
"system.first_run_shown",
233 &m_System.first_run_shown,
false ) );
235 m_params.emplace_back(
new PARAM<int>(
"system.max_undo_items",
236 &m_System.max_undo_items, 0 ) );
240 &m_System.file_history, {} ) );
242 if( m_filename == wxS(
"pl_editor" )
243 || m_filename == wxS(
"eeschema" )
244 || m_filename == wxS(
"symbol_editor" ) )
246 m_params.emplace_back(
new PARAM<int>(
"system.units",
251 m_params.emplace_back(
new PARAM<int>(
"system.units",
255 m_params.emplace_back(
new PARAM<int>(
"system.last_metric_units",
256 &m_System.last_metric_units,
static_cast<int>(
EDA_UNITS::MM ) ) );
258 m_params.emplace_back(
new PARAM<int>(
"system.last_imperial_units",
259 &m_System.last_imperial_units,
static_cast<int>(
EDA_UNITS::MILS ) ) );
261 m_params.emplace_back(
new PARAM<bool>(
"system.show_import_issues",
262 &m_System.show_import_issues,
true ) );
265 [&]() -> nlohmann::json
267 nlohmann::json js = nlohmann::json::array();
269 for( const auto& [identifier, visible] : m_Plugins.actions )
270 js.push_back( nlohmann::json( { { identifier.ToUTF8(), visible } } ) );
274 [&](
const nlohmann::json& aObj )
276 m_Plugins.actions.clear();
278 if( !aObj.is_array() )
283 for(
const auto& entry : aObj )
285 if( entry.empty() || !entry.is_object() )
288 for(
const auto& pair : entry.items() )
290 m_Plugins.actions.emplace_back( std::make_pair( wxString( pair.key().c_str(), wxConvUTF8 ),
295 nlohmann::json::array() ) );
300 m_params.emplace_back(
new PARAM<bool>(
"appearance.custom_toolbars",
301 &m_CustomToolbars,
false ) );
307 addParamsForWindow( &m_Window,
"window" );
309 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.on_selection",
310 &m_CrossProbing.on_selection,
true ) );
312 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.center_on_items",
313 &m_CrossProbing.center_on_items,
true ) );
315 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.zoom_to_fit",
316 &m_CrossProbing.zoom_to_fit,
true ) );
318 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.auto_highlight",
319 &m_CrossProbing.auto_highlight,
true ) );
321 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.flash_selection",
322 &m_CrossProbing.flash_selection,
false ) );
388 const int find_replace_history_size = 10;
389 nlohmann::json find_history = nlohmann::json::array();
390 nlohmann::json replace_history = nlohmann::json::array();
391 wxString tmp, find_key, replace_key;
393 for(
int i = 0; i < find_replace_history_size; ++i )
395 find_key.Printf(
"FindStringHistoryList%d", i );
396 replace_key.Printf(
"ReplaceStringHistoryList%d", i );
398 if( aCfg->Read( find_key, &tmp ) )
399 find_history.push_back( tmp.ToStdString() );
401 if( aCfg->Read( replace_key, &tmp ) )
402 replace_history.push_back( tmp.ToStdString() );
405 Set(
"find_replace.find_history", find_history );
406 Set(
"find_replace.replace_history", replace_history );