From 0dcf95ee1aba2bbef308c9c102374b5bf55e77ef Mon Sep 17 00:00:00 2001 From: Dan Weatherill Date: Thu, 4 Jan 2018 19:28:54 +0000 Subject: [PATCH] automatically add extension to sim workbook files CHANGED: When a workbook file is saved from the simulation dialog in eeschema, the extension is automatically added if it is not specified. This behaviour is consistent with the workbook loading dialog, which filters the filelist for only ".wbk" files with no "all files" option. --- eeschema/sim/sim_plot_frame.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 96f8ac47a6..9a8485fd59 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -706,7 +706,16 @@ bool SIM_PLOT_FRAME::loadWorkbook( const wxString& aPath ) bool SIM_PLOT_FRAME::saveWorkbook( const wxString& aPath ) { - wxTextFile file( aPath ); + + wxString savePath = aPath; + + if( !savePath.Lower().EndsWith(".wbk")) + { + savePath += ".wbk"; + }; + + + wxTextFile file( savePath ); if( file.Exists() ) {