From c4bfca251b489c2d61a2c03888b1026bec33211d Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 27 Dec 2020 19:17:58 -0500 Subject: [PATCH] PcbNew: show file format conversion warning in infobar Fixes https://gitlab.com/kicad/code/kicad/-/issues/6200 --- pcbnew/files.cpp | 16 +++++++++++----- pcbnew/pcb_edit_frame.cpp | 1 - 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 8424aaa1a7..acaf10474b 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ #include #include #include +#include #include #include "footprint_info_impl.h" @@ -729,12 +731,16 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in else GetScreen()->ClrModify(); - if( pluginType == IO_MGR::LEGACY && - loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION ) + if( ( pluginType == IO_MGR::LEGACY && + loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION ) || + ( pluginType == IO_MGR::KICAD_SEXP && + loadedBoard->GetFileFormatVersionAtLoad() < SEXPR_BOARD_FILE_VERSION ) ) { - DisplayInfoMessage( this, - _( "This file was created by an older version of Pcbnew.\n" - "It will be stored in the new file format when you save this file again." ) ); + m_infoBar->RemoveAllButtons(); + m_infoBar->AddCloseButton(); + m_infoBar->ShowMessage( _( "This file was created by an older version of KiCad. " + "It will be converted to the new format when saved." ), + wxICON_WARNING ); } } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index aa1162bcd2..5cb7639f1c 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1046,7 +1046,6 @@ void PCB_EDIT_FRAME::onBoardLoaded() UpdateTitle(); wxFileName fn = GetBoard()->GetFileName(); - m_infoBar->Dismiss(); // Display a warning that the file is read only if( fn.FileExists() && !fn.IsFileWritable() )