From e8ef86386102e1a27261cabd4ff1fe7e944fefe3 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 9 Mar 2022 17:11:02 -0800 Subject: [PATCH] Remove double-call of settings from Netlister Double-calls are no longer needed when using settings. They can interfere depending on how the system executes the commands. Removing keeps the last used plugin as the default, rather than the last selected Fixes https://gitlab.com/kicad/code/kicad/issues/11094 --- eeschema/dialogs/dialog_netlist.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index 85cf4dea71..7d3e701983 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -168,7 +168,6 @@ private: public: SCH_EDIT_FRAME* m_Parent; - wxString m_DefaultNetFmtName; NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX]; }; @@ -242,8 +241,6 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : SCHEMATIC_SETTINGS& settings = m_Parent->Schematic().Settings(); - m_DefaultNetFmtName = settings.m_NetFormatName; - for( NETLIST_PAGE_DIALOG*& page : m_PanelNetType) page = nullptr; @@ -421,8 +418,6 @@ void NETLIST_DIALOG::OnNetlistTypeSelection( wxNotebookEvent& event ) if( currPage == nullptr ) return; - m_DefaultNetFmtName = currPage->GetPageNetFmtName(); - m_buttonDelGenerator->Enable( currPage->m_IdNetType >= NET_TYPE_CUSTOM1 ); } @@ -436,7 +431,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt() settings.m_SpiceAdjustPassiveValues = adjust; settings.m_SpiceCommandString = spice_cmd_string; - settings.m_NetFormatName = m_DefaultNetFmtName; + settings.m_NetFormatName = m_PanelNetType[m_NoteBook->GetSelection()]->GetPageNetFmtName(); } @@ -595,7 +590,6 @@ void NETLIST_DIALOG::OnDelGenerator( wxCommandEvent& event ) currPage->m_CommandStringCtrl->SetValue( wxEmptyString ); currPage->m_TitleStringCtrl->SetValue( wxEmptyString ); - m_DefaultNetFmtName = m_PanelNetType[PANELPCBNEW]->GetPageNetFmtName(); WriteCurrentNetlistSetup(); @@ -722,17 +716,8 @@ int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller ) { NETLIST_DIALOG dlg( aCaller ); - SCHEMATIC_SETTINGS& settings = aCaller->Schematic().Settings(); - - wxString curr_default_netformat = settings.m_NetFormatName; - int ret = dlg.ShowModal(); - - // Update the default netlist and store it in prj config if it was explicitly changed. - settings.m_NetFormatName = dlg.m_DefaultNetFmtName; // can have temporary changed - - if( curr_default_netformat != dlg.m_DefaultNetFmtName ) - aCaller->SaveProjectSettings(); + aCaller->SaveProjectSettings(); return ret; }