104 "design_block_chooser.lib_tree.column_widths",
105 [&]() -> nlohmann::json
107 nlohmann::json ret = nlohmann::json::object();
109 for( const auto& [name, width] : m_DesignBlockChooserPanel.tree.column_widths )
110 ret[std::string( name.ToUTF8() )] = width;
114 [&](
const nlohmann::json& aJson )
116 if( !aJson.is_object() )
119 m_DesignBlockChooserPanel.tree.column_widths.clear();
121 for( const auto& entry : aJson.items() )
123 if( !entry.value().is_number_integer() )
126 m_DesignBlockChooserPanel.tree.column_widths[entry.key()] = entry.value().get<int>();
132 m_params.back()->SetClearUnknownKeys();
134 m_params.emplace_back(
new PARAM<float>(
"graphics.highlight_factor",
135 &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) );
137 m_params.emplace_back(
new PARAM<float>(
"graphics.select_factor",
138 &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) );
140 m_params.emplace_back(
new PARAM<int>(
"color_picker.default_tab",
141 &m_ColorPicker.default_tab, 0 ) );
143 m_params.emplace_back(
new PARAM_LIST<wxString>(
"lib_tree.columns", &m_LibTree.columns, {} ) );
146 [&]() -> nlohmann::json
148 nlohmann::json ret = nlohmann::json::object();
150 for( const std::pair<const wxString, int>& pair : m_LibTree.column_widths )
151 ret[std::string( pair.first.ToUTF8() )] = pair.second;
155 [&](
const nlohmann::json& aJson )
157 if( !aJson.is_object() )
160 m_LibTree.column_widths.clear();
162 for( const auto& entry : aJson.items() )
164 if( !entry.value().is_number_integer() )
167 m_LibTree.column_widths[ entry.key() ] = entry.value().get<int>();
173 m_params.back()->SetClearUnknownKeys();
175 m_params.emplace_back(
178 m_params.emplace_back(
new PARAM<bool>(
"printing.background",
179 &m_Printing.background,
false ) );
181 m_params.emplace_back(
new PARAM<bool>(
"printing.monochrome",
182 &m_Printing.monochrome,
true ) );
185 &m_Printing.scale, 1.0 ) );
187 m_params.emplace_back(
new PARAM<bool>(
"printing.use_theme",
188 &m_Printing.use_theme,
false ) );
191 &m_Printing.color_theme, wxS(
"" ) ) );
193 m_params.emplace_back(
new PARAM<bool>(
"printing.title_block",
194 &m_Printing.title_block,
false ) );
197 &m_Printing.layers, {} ) );
199 m_params.emplace_back(
new PARAM<bool>(
"printing.mirror",
200 &m_Printing.mirror,
false ) );
202 m_params.emplace_back(
new PARAM<int>(
"printing.drill_marks",
203 &m_Printing.drill_marks, 1 ) );
205 m_params.emplace_back(
new PARAM<int>(
"printing.pagination",
206 &m_Printing.pagination, 1 ) );
208 m_params.emplace_back(
new PARAM<bool>(
"printing.edge_cuts_on_all_pages",
209 &m_Printing.edge_cuts_on_all_pages,
true ) );
211 m_params.emplace_back(
new PARAM<bool>(
"printing.as_item_checkboxes",
212 &m_Printing.as_item_checkboxes,
false ) );
214 m_params.emplace_back(
new PARAM<int>(
"search_pane.selection_zoom",
215 reinterpret_cast<int*
>( &m_SearchPane.selection_zoom ),
216 static_cast<int>( SEARCH_PANE::SELECTION_ZOOM::PAN ) ) );
218 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_hidden_fields",
219 &m_SearchPane.search_hidden_fields,
true ) );
221 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_metadata",
222 &m_SearchPane.search_metadata,
false ) );
224 m_params.emplace_back(
new PARAM<bool>(
"system.first_run_shown",
225 &m_System.first_run_shown,
false ) );
227 m_params.emplace_back(
new PARAM<int>(
"system.max_undo_items",
228 &m_System.max_undo_items, 0 ) );
232 &m_System.file_history, {} ) );
234 if( m_filename == wxS(
"pl_editor" )
235 || ( m_filename == wxS(
"eeschema" ) || m_filename == wxS(
"symbol_editor" ) ) )
237 m_params.emplace_back(
new PARAM<int>(
"system.units",
242 m_params.emplace_back(
new PARAM<int>(
"system.units",
246 m_params.emplace_back(
new PARAM<int>(
"system.last_metric_units",
247 &m_System.last_metric_units,
static_cast<int>(
EDA_UNITS::MM ) ) );
249 m_params.emplace_back(
new PARAM<int>(
"system.last_imperial_units",
250 &m_System.last_imperial_units,
static_cast<int>(
EDA_UNITS::MILS ) ) );
252 m_params.emplace_back(
new PARAM<bool>(
"system.show_import_issues",
253 &m_System.show_import_issues,
true ) );
256 [&]() -> nlohmann::json
258 nlohmann::json js = nlohmann::json::array();
260 for( const auto& [identifier, visible] : m_Plugins.actions )
261 js.push_back( nlohmann::json( { { identifier.ToUTF8(), visible } } ) );
265 [&](
const nlohmann::json& aObj )
267 m_Plugins.actions.clear();
269 if( !aObj.is_array() )
274 for(
const auto& entry : aObj )
276 if( entry.empty() || !entry.is_object() )
279 for(
const auto& pair : entry.items() )
281 m_Plugins.actions.emplace_back( std::make_pair(
282 wxString( pair.key().c_str(), wxConvUTF8 ), pair.value() ) );
286 nlohmann::json::array() ) );
291 m_params.emplace_back(
new PARAM<bool>(
"appearance.custom_toolbars",
292 &m_CustomToolbars,
false ) );
294 addParamsForWindow( &m_Window,
"window" );
296 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.on_selection",
297 &m_CrossProbing.on_selection,
true ) );
299 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.center_on_items",
300 &m_CrossProbing.center_on_items,
true ) );
302 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.zoom_to_fit",
303 &m_CrossProbing.zoom_to_fit,
true ) );
305 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.auto_highlight",
306 &m_CrossProbing.auto_highlight,
true ) );
308 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.flash_selection",
309 &m_CrossProbing.flash_selection,
false ) );
376 const int find_replace_history_size = 10;
377 nlohmann::json find_history = nlohmann::json::array();
378 nlohmann::json replace_history = nlohmann::json::array();
379 wxString tmp, find_key, replace_key;
381 for(
int i = 0; i < find_replace_history_size; ++i )
383 find_key.Printf(
"FindStringHistoryList%d", i );
384 replace_key.Printf(
"ReplaceStringHistoryList%d", i );
386 if( aCfg->Read( find_key, &tmp ) )
387 find_history.push_back( tmp.ToStdString() );
389 if( aCfg->Read( replace_key, &tmp ) )
390 replace_history.push_back( tmp.ToStdString() );
393 Set(
"find_replace.find_history", find_history );
394 Set(
"find_replace.replace_history", replace_history );