PcbNew: show file format conversion warning in infobar
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6200
This commit is contained in:
parent
3c87e67753
commit
c4bfca251b
|
@ -45,6 +45,7 @@
|
||||||
#include <ratsnest/ratsnest_data.h>
|
#include <ratsnest/ratsnest_data.h>
|
||||||
#include <kiplatform/app.h>
|
#include <kiplatform/app.h>
|
||||||
#include <widgets/appearance_controls.h>
|
#include <widgets/appearance_controls.h>
|
||||||
|
#include <widgets/infobar.h>
|
||||||
#include <wx/wupdlock.h>
|
#include <wx/wupdlock.h>
|
||||||
#include <settings/common_settings.h>
|
#include <settings/common_settings.h>
|
||||||
#include <settings/settings_manager.h>
|
#include <settings/settings_manager.h>
|
||||||
|
@ -53,6 +54,7 @@
|
||||||
#include <project/net_settings.h>
|
#include <project/net_settings.h>
|
||||||
#include <plugins/cadstar/cadstar_pcb_archive_plugin.h>
|
#include <plugins/cadstar/cadstar_pcb_archive_plugin.h>
|
||||||
#include <plugins/eagle/eagle_plugin.h>
|
#include <plugins/eagle/eagle_plugin.h>
|
||||||
|
#include <plugins/kicad/kicad_plugin.h>
|
||||||
#include <dialogs/dialog_imported_layers.h>
|
#include <dialogs/dialog_imported_layers.h>
|
||||||
#include "footprint_info_impl.h"
|
#include "footprint_info_impl.h"
|
||||||
|
|
||||||
|
@ -729,12 +731,16 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
else
|
else
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
|
|
||||||
if( pluginType == IO_MGR::LEGACY &&
|
if( ( pluginType == IO_MGR::LEGACY &&
|
||||||
loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION )
|
loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION ) ||
|
||||||
|
( pluginType == IO_MGR::KICAD_SEXP &&
|
||||||
|
loadedBoard->GetFileFormatVersionAtLoad() < SEXPR_BOARD_FILE_VERSION ) )
|
||||||
{
|
{
|
||||||
DisplayInfoMessage( this,
|
m_infoBar->RemoveAllButtons();
|
||||||
_( "This file was created by an older version of Pcbnew.\n"
|
m_infoBar->AddCloseButton();
|
||||||
"It will be stored in the new file format when you save this file again." ) );
|
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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1046,7 +1046,6 @@ void PCB_EDIT_FRAME::onBoardLoaded()
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
|
|
||||||
wxFileName fn = GetBoard()->GetFileName();
|
wxFileName fn = GetBoard()->GetFileName();
|
||||||
m_infoBar->Dismiss();
|
|
||||||
|
|
||||||
// Display a warning that the file is read only
|
// Display a warning that the file is read only
|
||||||
if( fn.FileExists() && !fn.IsFileWritable() )
|
if( fn.FileExists() && !fn.IsFileWritable() )
|
||||||
|
|
Loading…
Reference in New Issue