103 "design_block_chooser.lib_tree.column_widths",
104 [&]() -> nlohmann::json
106 nlohmann::json ret = {};
109 ret[std::string(
name.ToUTF8() )] = width;
113 [&](
const nlohmann::json& aJson )
115 if( !aJson.is_object() )
118 m_DesignBlockChooserPanel.tree.column_widths.clear();
120 for(
const auto& entry : aJson.items() )
122 if( !entry.value().is_number_integer() )
125 m_DesignBlockChooserPanel.tree.column_widths[entry.key()] = entry.value().get<
int>();
130 m_params.emplace_back(
new PARAM<float>(
"graphics.highlight_factor",
131 &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) );
133 m_params.emplace_back(
new PARAM<float>(
"graphics.select_factor",
134 &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) );
136 m_params.emplace_back(
new PARAM<int>(
"color_picker.default_tab",
137 &m_ColorPicker.default_tab, 0 ) );
139 m_params.emplace_back(
new PARAM_LIST<wxString>(
"lib_tree.columns", &m_LibTree.columns, {} ) );
142 [&]() -> nlohmann::json
144 nlohmann::json ret = {};
146 for(
const std::pair<const wxString, int>& pair : m_LibTree.column_widths )
147 ret[std::string( pair.first.ToUTF8() )] = pair.second;
151 [&](
const nlohmann::json& aJson )
153 if( !aJson.is_object() )
156 m_LibTree.column_widths.clear();
158 for(
const auto& entry : aJson.items() )
160 if( !entry.value().is_number_integer() )
163 m_LibTree.column_widths[ entry.key() ] = entry.value().get<
int>();
168 m_params.emplace_back(
171 m_params.emplace_back(
new PARAM<bool>(
"printing.background",
172 &m_Printing.background,
false ) );
174 m_params.emplace_back(
new PARAM<bool>(
"printing.monochrome",
175 &m_Printing.monochrome,
true ) );
178 &m_Printing.scale, 1.0 ) );
180 m_params.emplace_back(
new PARAM<bool>(
"printing.use_theme",
181 &m_Printing.use_theme,
false ) );
184 &m_Printing.color_theme, wxS(
"" ) ) );
186 m_params.emplace_back(
new PARAM<bool>(
"printing.title_block",
187 &m_Printing.title_block,
false ) );
190 &m_Printing.layers, {} ) );
192 m_params.emplace_back(
new PARAM<bool>(
"printing.mirror",
193 &m_Printing.mirror,
false ) );
195 m_params.emplace_back(
new PARAM<int>(
"printing.drill_marks",
196 &m_Printing.drill_marks, 1 ) );
198 m_params.emplace_back(
new PARAM<int>(
"printing.pagination",
199 &m_Printing.pagination, 1 ) );
201 m_params.emplace_back(
new PARAM<bool>(
"printing.edge_cuts_on_all_pages",
202 &m_Printing.edge_cuts_on_all_pages,
true ) );
204 m_params.emplace_back(
new PARAM<bool>(
"printing.as_item_checkboxes",
205 &m_Printing.as_item_checkboxes,
false ) );
207 m_params.emplace_back(
new PARAM<int>(
"search_pane.selection_zoom",
208 reinterpret_cast<int*
>( &m_SearchPane.selection_zoom ),
209 static_cast<int>( SEARCH_PANE::SELECTION_ZOOM::PAN ) ) );
211 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_hidden_fields",
212 &m_SearchPane.search_hidden_fields,
true ) );
214 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_metadata",
215 &m_SearchPane.search_metadata,
false ) );
217 m_params.emplace_back(
new PARAM<bool>(
"system.first_run_shown",
218 &m_System.first_run_shown,
false ) );
220 m_params.emplace_back(
new PARAM<int>(
"system.max_undo_items",
221 &m_System.max_undo_items, 0 ) );
225 &m_System.file_history, {} ) );
227 if( m_filename == wxS(
"pl_editor" )
228 || ( m_filename == wxS(
"eeschema" ) || m_filename == wxS(
"symbol_editor" ) ) )
230 m_params.emplace_back(
new PARAM<int>(
"system.units",
235 m_params.emplace_back(
new PARAM<int>(
"system.units",
239 m_params.emplace_back(
new PARAM<int>(
"system.last_metric_units",
240 &m_System.last_metric_units,
static_cast<int>(
EDA_UNITS::MM ) ) );
242 m_params.emplace_back(
new PARAM<int>(
"system.last_imperial_units",
243 &m_System.last_imperial_units,
static_cast<int>(
EDA_UNITS::MILS ) ) );
245 m_params.emplace_back(
new PARAM<bool>(
"system.show_import_issues",
246 &m_System.show_import_issues,
true ) );
249 [&]() -> nlohmann::json
251 nlohmann::json js = nlohmann::json::array();
253 for( const auto& [identifier, visible] : m_Plugins.actions )
254 js.push_back( nlohmann::json( { { identifier.ToUTF8(), visible } } ) );
258 [&](
const nlohmann::json& aObj )
260 m_Plugins.actions.clear();
262 if( !aObj.is_array() )
267 for(
const auto& entry : aObj )
269 if( entry.empty() || !entry.is_object() )
272 for(
const auto& pair : entry.items() )
274 m_Plugins.actions.emplace_back( std::make_pair(
275 wxString( pair.key().c_str(), wxConvUTF8 ), pair.value() ) );
279 nlohmann::json::array() ) );
284 m_params.emplace_back(
new PARAM<bool>(
"appearance.custom_toolbars",
285 &m_CustomToolbars,
false ) );
287 addParamsForWindow( &m_Window,
"window" );
289 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.on_selection",
290 &m_CrossProbing.on_selection,
true ) );
292 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.center_on_items",
293 &m_CrossProbing.center_on_items,
true ) );
295 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.zoom_to_fit",
296 &m_CrossProbing.zoom_to_fit,
true ) );
298 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.auto_highlight",
299 &m_CrossProbing.auto_highlight,
true ) );
301 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.flash_selection",
302 &m_CrossProbing.flash_selection,
false ) );
369 const int find_replace_history_size = 10;
370 nlohmann::json find_history = nlohmann::json::array();
371 nlohmann::json replace_history = nlohmann::json::array();
372 wxString tmp, find_key, replace_key;
374 for(
int i = 0; i < find_replace_history_size; ++i )
376 find_key.Printf(
"FindStringHistoryList%d", i );
377 replace_key.Printf(
"ReplaceStringHistoryList%d", i );
379 if( aCfg->Read( find_key, &tmp ) )
380 find_history.push_back( tmp.ToStdString() );
382 if( aCfg->Read( replace_key, &tmp ) )
383 replace_history.push_back( tmp.ToStdString() );
386 Set(
"find_replace.find_history", find_history );
387 Set(
"find_replace.replace_history", replace_history );