7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 10:51:41 +00:00

Save user-defined nicknames.

While name and path fields would make more sense, this commit
encodes the nickname as an "opts" field so that older versions will
still read the preferences file.
This commit is contained in:
Jeff Young 2018-12-28 20:30:37 +00:00
parent e856a7a09c
commit ad0d9f8df0

View File

@ -144,7 +144,14 @@ void BOM_CFG_PARSER::parsePlugin()
NeedSYMBOLorNUMBER();
if( plugin )
plugin->Options().Add( FromUTF8() );
{
wxString option = FromUTF8();
if( option.StartsWith( "nickname=", &name ) )
plugin->SetName( name );
else
plugin->Options().Add( option );
}
NeedRIGHT();
break;
@ -235,7 +242,6 @@ DIALOG_BOM::DIALOG_BOM( SCH_EDIT_FRAME* parent ) :
SetInitialFocus( m_lbPlugins );
m_sdbSizer1OK->SetDefault();
wxLogDebug( "TEEEEST" );
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
@ -266,6 +272,14 @@ DIALOG_BOM::~DIALOG_BOM()
writer.Quotew( plugin->Options().Item( jj ) ).c_str() );
}
if( !plugin->GetName().IsEmpty() )
{
wxString option = wxString::Format( "nickname=%s", plugin->GetName() );
writer.Print( 1, "(opts %s)",
writer.Quotew( option ).c_str() );
}
writer.Print( 0, ")" );
}