Remove Save Copy As from fp editor, and rename to Save a Copy elsewhere.
It's still used by Eeschema and PCBNew when not in stand-alone mode. Fixes https://gitlab.com/kicad/code/kicad/issues/9185
This commit is contained in:
parent
3304ad75ca
commit
90bfe2d94b
|
@ -73,10 +73,10 @@ TOOL_ACTION ACTIONS::saveAs( "common.Control.saveAs",
|
|||
_( "Save As..." ), _( "Save current document to another location" ),
|
||||
BITMAPS::save_as );
|
||||
|
||||
TOOL_ACTION ACTIONS::saveCopyAs( "common.Control.saveCopyAs",
|
||||
TOOL_ACTION ACTIONS::saveCopy( "common.Control.saveCopy",
|
||||
AS_GLOBAL,
|
||||
0, "",
|
||||
_( "Save Copy As..." ), _( "Save a copy of the current document to another location" ),
|
||||
_( "Save a Copy..." ), _( "Save a copy of the current document to another location" ),
|
||||
BITMAPS::save_as );
|
||||
|
||||
TOOL_ACTION ACTIONS::saveAll( "common.Control.saveAll",
|
||||
|
|
|
@ -782,7 +782,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
wxString msg;
|
||||
SCH_SCREEN* screen;
|
||||
SCH_SCREENS screens( Schematic().Root() );
|
||||
bool saveCopyAs = aSaveAs && !Kiface().IsSingle();
|
||||
bool saveCopy = aSaveAs && !Kiface().IsSingle();
|
||||
bool success = true;
|
||||
bool updateFileType = false;
|
||||
bool createNewProject = false;
|
||||
|
@ -850,7 +850,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
if( wxWindow* ec = dlg.GetExtraControl() )
|
||||
createNewProject = static_cast<CREATE_PROJECT_CHECKBOX*>( ec )->GetValue();
|
||||
|
||||
if( !saveCopyAs )
|
||||
if( !saveCopy )
|
||||
{
|
||||
Schematic().Root().SetFileName( newFileName.GetFullName() );
|
||||
Schematic().RootScreen()->SetFileName( newFileName.GetFullPath() );
|
||||
|
@ -914,7 +914,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
return false;
|
||||
}
|
||||
|
||||
if( saveCopyAs )
|
||||
if( saveCopy )
|
||||
filenameMap[screen] = tmp.GetFullPath();
|
||||
else
|
||||
screen->SetFileName( tmp.GetFullPath() );
|
||||
|
@ -932,7 +932,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
}
|
||||
}
|
||||
|
||||
if( filenameMap.empty() || !saveCopyAs )
|
||||
if( filenameMap.empty() || !saveCopy )
|
||||
{
|
||||
for( size_t i = 0; i < screens.GetCount(); i++ )
|
||||
filenameMap[screens.GetScreen( i )] = screens.GetScreen( i )->GetFileName();
|
||||
|
@ -1015,7 +1015,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
|
||||
filenameMap[screen] = tmpFn.GetFullPath();
|
||||
|
||||
if( !saveCopyAs )
|
||||
if( !saveCopy )
|
||||
screen->SetFileName( tmpFn.GetFullPath() );
|
||||
}
|
||||
|
||||
|
@ -1027,7 +1027,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
screen->SetVirtualPageNumber( 0 ); // multiple uses; no way to store the real sheet #
|
||||
|
||||
// This is a new schematic file so make sure it has a unique ID.
|
||||
if( !saveCopyAs && tmpFn.GetFullPath() != screen->GetFileName() )
|
||||
if( !saveCopy && tmpFn.GetFullPath() != screen->GetFileName() )
|
||||
screen->AssignNewUuid();
|
||||
|
||||
success &= saveSchematicFile( screens.GetSheet( i ), tmpFn.GetFullPath() );
|
||||
|
@ -1072,12 +1072,12 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
|||
wxFileName projectPath( filenameMap.at( Schematic().RootScreen() ) );
|
||||
projectPath.SetExt( ProjectFileExtension );
|
||||
|
||||
if( Prj().IsNullProject() || ( aSaveAs && !saveCopyAs ) )
|
||||
if( Prj().IsNullProject() || ( aSaveAs && !saveCopy ) )
|
||||
{
|
||||
Prj().SetReadOnly( !createNewProject );
|
||||
GetSettingsManager()->SaveProjectAs( projectPath.GetFullPath() );
|
||||
}
|
||||
else if( saveCopyAs && createNewProject )
|
||||
else if( saveCopy && createNewProject )
|
||||
{
|
||||
GetSettingsManager()->SaveProjectCopy( projectPath.GetFullPath() );
|
||||
}
|
||||
|
|
|
@ -2333,7 +2333,6 @@ void SCH_EDITOR_CONTROL::setTransitions()
|
|||
Go( &SCH_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() );
|
||||
//Go( &SCH_EDITOR_CONTROL::SaveAs, ACTIONS::saveCopyAs.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::SaveCurrSheetCopyAs, EE_ACTIONS::saveCurrSheetCopyAs.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::ShowSchematicSetup, EE_ACTIONS::schematicSetup.MakeEvent() );
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
static TOOL_ACTION open;
|
||||
static TOOL_ACTION save;
|
||||
static TOOL_ACTION saveAs;
|
||||
static TOOL_ACTION saveCopyAs;
|
||||
static TOOL_ACTION saveCopy;
|
||||
static TOOL_ACTION saveAll;
|
||||
static TOOL_ACTION revert;
|
||||
static TOOL_ACTION pageSettings;
|
||||
|
|
|
@ -97,7 +97,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
if( Kiface().IsSingle() )
|
||||
fileMenu->Add( ACTIONS::saveAs );
|
||||
else
|
||||
fileMenu->Add( ACTIONS::saveCopyAs );
|
||||
fileMenu->Add( ACTIONS::saveCopy );
|
||||
|
||||
fileMenu->Add( ACTIONS::revert );
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ int BOARD_EDITOR_CONTROL::SaveAs( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int BOARD_EDITOR_CONTROL::SaveCopyAs( const TOOL_EVENT& aEvent )
|
||||
int BOARD_EDITOR_CONTROL::SaveCopy( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->Files_io_from_id( ID_COPY_BOARD_AS );
|
||||
return 0;
|
||||
|
@ -1609,7 +1609,7 @@ void BOARD_EDITOR_CONTROL::setTransitions()
|
|||
Go( &BOARD_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::SaveCopyAs, ACTIONS::saveCopyAs.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::SaveCopy, ACTIONS::saveCopy.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::PageSettings, ACTIONS::pageSettings.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() );
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
int Open( const TOOL_EVENT& aEvent );
|
||||
int Save( const TOOL_EVENT& aEvent );
|
||||
int SaveAs( const TOOL_EVENT& aEvent );
|
||||
int SaveCopyAs( const TOOL_EVENT& aEvent );
|
||||
int SaveCopy( const TOOL_EVENT& aEvent );
|
||||
int Revert( const TOOL_EVENT& aEvent );
|
||||
int PageSettings( const TOOL_EVENT& aEvent );
|
||||
int Plot( const TOOL_EVENT& aEvent );
|
||||
|
|
|
@ -120,8 +120,7 @@ bool FOOTPRINT_EDITOR_CONTROL::Init()
|
|||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( ACTIONS::save, libSelectedCondition || libInferredCondition );
|
||||
ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition );
|
||||
ctxMenu.AddItem( ACTIONS::saveCopyAs, fpSelectedCondition );
|
||||
ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition || fpSelectedCondition );
|
||||
ctxMenu.AddItem( ACTIONS::revert, libSelectedCondition || libInferredCondition );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
|
@ -284,7 +283,7 @@ int FOOTPRINT_EDITOR_CONTROL::SaveAs( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else if( m_frame->GetTargetFPID() == m_frame->GetLoadedFPID() )
|
||||
{
|
||||
// Save Board Footprint As
|
||||
// Save Footprint As
|
||||
if( footprint() && m_frame->SaveFootprintAs( footprint() ) )
|
||||
{
|
||||
view()->Update( footprint() );
|
||||
|
@ -720,7 +719,6 @@ void FOOTPRINT_EDITOR_CONTROL::setTransitions()
|
|||
Go( &FOOTPRINT_EDITOR_CONTROL::CreateFootprint, PCB_ACTIONS::createFootprint.MakeEvent() );
|
||||
Go( &FOOTPRINT_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
|
||||
Go( &FOOTPRINT_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() );
|
||||
Go( &FOOTPRINT_EDITOR_CONTROL::SaveAs, ACTIONS::saveCopyAs.MakeEvent() );
|
||||
Go( &FOOTPRINT_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
|
||||
Go( &FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint, PCB_ACTIONS::duplicateFootprint.MakeEvent() );
|
||||
Go( &FOOTPRINT_EDITOR_CONTROL::RenameFootprint, PCB_ACTIONS::renameFootprint.MakeEvent() );
|
||||
|
|
Loading…
Reference in New Issue