104 "design_block_chooser.lib_tree.column_widths",
105 [&]() -> nlohmann::json
107 nlohmann::json ret = {};
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>();
131 m_params.emplace_back(
new PARAM<float>(
"graphics.highlight_factor",
132 &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) );
134 m_params.emplace_back(
new PARAM<float>(
"graphics.select_factor",
135 &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) );
137 m_params.emplace_back(
new PARAM<int>(
"color_picker.default_tab",
138 &m_ColorPicker.default_tab, 0 ) );
140 m_params.emplace_back(
new PARAM_LIST<wxString>(
"lib_tree.columns", &m_LibTree.columns, {} ) );
143 [&]() -> nlohmann::json
145 nlohmann::json ret = {};
147 for(
const std::pair<const wxString, int>& pair : m_LibTree.column_widths )
148 ret[std::string( pair.first.ToUTF8() )] = pair.second;
152 [&](
const nlohmann::json& aJson )
154 if( !aJson.is_object() )
157 m_LibTree.column_widths.clear();
159 for(
const auto& entry : aJson.items() )
161 if( !entry.value().is_number_integer() )
164 m_LibTree.column_widths[ entry.key() ] = entry.value().get<
int>();
169 m_params.emplace_back(
172 m_params.emplace_back(
new PARAM<bool>(
"printing.background",
173 &m_Printing.background,
false ) );
175 m_params.emplace_back(
new PARAM<bool>(
"printing.monochrome",
176 &m_Printing.monochrome,
true ) );
179 &m_Printing.scale, 1.0 ) );
181 m_params.emplace_back(
new PARAM<bool>(
"printing.use_theme",
182 &m_Printing.use_theme,
false ) );
185 &m_Printing.color_theme, wxS(
"" ) ) );
187 m_params.emplace_back(
new PARAM<bool>(
"printing.title_block",
188 &m_Printing.title_block,
false ) );
191 &m_Printing.layers, {} ) );
193 m_params.emplace_back(
new PARAM<bool>(
"printing.mirror",
194 &m_Printing.mirror,
false ) );
196 m_params.emplace_back(
new PARAM<int>(
"printing.drill_marks",
197 &m_Printing.drill_marks, 1 ) );
199 m_params.emplace_back(
new PARAM<int>(
"printing.pagination",
200 &m_Printing.pagination, 1 ) );
202 m_params.emplace_back(
new PARAM<bool>(
"printing.edge_cuts_on_all_pages",
203 &m_Printing.edge_cuts_on_all_pages,
true ) );
205 m_params.emplace_back(
new PARAM<bool>(
"printing.as_item_checkboxes",
206 &m_Printing.as_item_checkboxes,
false ) );
208 m_params.emplace_back(
new PARAM<int>(
"search_pane.selection_zoom",
209 reinterpret_cast<int*
>( &m_SearchPane.selection_zoom ),
210 static_cast<int>( SEARCH_PANE::SELECTION_ZOOM::PAN ) ) );
212 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_hidden_fields",
213 &m_SearchPane.search_hidden_fields,
true ) );
215 m_params.emplace_back(
new PARAM<bool>(
"search_pane.search_metadata",
216 &m_SearchPane.search_metadata,
false ) );
218 m_params.emplace_back(
new PARAM<bool>(
"system.first_run_shown",
219 &m_System.first_run_shown,
false ) );
221 m_params.emplace_back(
new PARAM<int>(
"system.max_undo_items",
222 &m_System.max_undo_items, 0 ) );
226 &m_System.file_history, {} ) );
228 if( m_filename == wxS(
"pl_editor" )
229 || ( m_filename == wxS(
"eeschema" ) || m_filename == wxS(
"symbol_editor" ) ) )
231 m_params.emplace_back(
new PARAM<int>(
"system.units",
236 m_params.emplace_back(
new PARAM<int>(
"system.units",
240 m_params.emplace_back(
new PARAM<int>(
"system.last_metric_units",
241 &m_System.last_metric_units,
static_cast<int>(
EDA_UNITS::MM ) ) );
243 m_params.emplace_back(
new PARAM<int>(
"system.last_imperial_units",
244 &m_System.last_imperial_units,
static_cast<int>(
EDA_UNITS::MILS ) ) );
246 m_params.emplace_back(
new PARAM<bool>(
"system.show_import_issues",
247 &m_System.show_import_issues,
true ) );
250 [&]() -> nlohmann::json
252 nlohmann::json js = nlohmann::json::array();
254 for( const auto& [identifier, visible] : m_Plugins.actions )
255 js.push_back( nlohmann::json( { { identifier.ToUTF8(), visible } } ) );
259 [&](
const nlohmann::json& aObj )
261 m_Plugins.actions.clear();
263 if( !aObj.is_array() )
268 for(
const auto& entry : aObj )
270 if( entry.empty() || !entry.is_object() )
273 for(
const auto& pair : entry.items() )
275 m_Plugins.actions.emplace_back( std::make_pair(
276 wxString( pair.key().c_str(), wxConvUTF8 ), pair.value() ) );
280 nlohmann::json::array() ) );
285 m_params.emplace_back(
new PARAM<bool>(
"appearance.custom_toolbars",
286 &m_CustomToolbars,
false ) );
288 addParamsForWindow( &m_Window,
"window" );
290 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.on_selection",
291 &m_CrossProbing.on_selection,
true ) );
293 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.center_on_items",
294 &m_CrossProbing.center_on_items,
true ) );
296 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.zoom_to_fit",
297 &m_CrossProbing.zoom_to_fit,
true ) );
299 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.auto_highlight",
300 &m_CrossProbing.auto_highlight,
true ) );
302 m_params.emplace_back(
new PARAM<bool>(
"cross_probing.flash_selection",
303 &m_CrossProbing.flash_selection,
false ) );
370 const int find_replace_history_size = 10;
371 nlohmann::json find_history = nlohmann::json::array();
372 nlohmann::json replace_history = nlohmann::json::array();
373 wxString tmp, find_key, replace_key;
375 for(
int i = 0; i < find_replace_history_size; ++i )
377 find_key.Printf(
"FindStringHistoryList%d", i );
378 replace_key.Printf(
"ReplaceStringHistoryList%d", i );
380 if( aCfg->Read( find_key, &tmp ) )
381 find_history.push_back( tmp.ToStdString() );
383 if( aCfg->Read( replace_key, &tmp ) )
384 replace_history.push_back( tmp.ToStdString() );
387 Set(
"find_replace.find_history", find_history );
388 Set(
"find_replace.replace_history", replace_history );