Minor cleanup.

This commit is contained in:
Jeff Young 2021-04-01 11:04:59 +01:00
parent 0c4184f1a4
commit 94470bfa15
4 changed files with 13 additions and 18 deletions

View File

@ -138,7 +138,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
auto sdbSizer = new wxStdDialogButtonSizer(); auto sdbSizer = new wxStdDialogButtonSizer();
m_saveAndContinue = new wxButton( bottomPanel, ID_SAVE_PROJECT, m_saveAndContinue = new wxButton( bottomPanel, wxID_ANY,
_( "Apply, Save Schematic && Continue" ) ); _( "Apply, Save Schematic && Continue" ) );
buttonsSizer->Add( m_saveAndContinue, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 20 ); buttonsSizer->Add( m_saveAndContinue, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 20 );

View File

@ -131,7 +131,6 @@ void DIALOG_CONFIG_EQUFILES::OnOkClick( wxCommandEvent& event )
for( unsigned ii = 0; ii < m_ListEquiv->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_ListEquiv->GetCount(); ii++ )
project.m_EquivalenceFiles.emplace_back( m_ListEquiv->GetString( ii ) ); project.m_EquivalenceFiles.emplace_back( m_ListEquiv->GetString( ii ) );
wxCommandEvent evt( ID_SAVE_PROJECT );
Pgm().GetSettingsManager().SaveProject(); Pgm().GetSettingsManager().SaveProject();
} }

View File

@ -74,7 +74,6 @@ enum main_id
ID_RUN_PCB = wxID_HIGHEST, ID_RUN_PCB = wxID_HIGHEST,
ID_APPEND_PROJECT, ID_APPEND_PROJECT,
ID_SAVE_PROJECT,
ID_LOAD_FILE, ID_LOAD_FILE,
ID_NEW_BOARD, ID_NEW_BOARD,
ID_SAVE_BOARD, ID_SAVE_BOARD,

View File

@ -928,9 +928,8 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
if( !IsWritable( pcbFileName ) ) if( !IsWritable( pcbFileName ) )
{ {
wxString msg = wxString::Format( _( wxString msg = wxString::Format( _( "No access rights to write to file \"%s\"" ),
"No access rights to write to file \"%s\"" ), pcbFileName.GetFullPath() );
pcbFileName.GetFullPath() );
DisplayError( this, msg ); DisplayError( this, msg );
return false; return false;
@ -992,13 +991,12 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
wxString msg = wxString::Format( _( wxString msg = wxString::Format( _( "Error saving board file '%s'.\n%s" ),
"Error saving board file \"%s\".\n%s" ), pcbFileName.GetFullPath(),
pcbFileName.GetFullPath(), ioe.What() ioe.What() );
);
DisplayError( this, msg ); DisplayError( this, msg );
lowerTxt.Printf( _( "Failed to create temporary file \"%s\"" ), tempFile.GetFullPath() ); lowerTxt.Printf( _( "Failed to create temporary file '%s'." ), tempFile.GetFullPath() );
SetMsgPanel( upperTxt, lowerTxt ); SetMsgPanel( upperTxt, lowerTxt );
@ -1034,7 +1032,6 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
} }
GetBoard()->SetFileName( pcbFileName.GetFullPath() ); GetBoard()->SetFileName( pcbFileName.GetFullPath() );
UpdateTitle();
// Put the saved file in File History if requested // Put the saved file in File History if requested
if( addToHistory ) if( addToHistory )
@ -1048,7 +1045,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
if( autoSaveFileName.FileExists() ) if( autoSaveFileName.FileExists() )
wxRemoveFile( autoSaveFileName.GetFullPath() ); wxRemoveFile( autoSaveFileName.GetFullPath() );
lowerTxt.Printf( _( "File \"%s\" saved." ), pcbFileName.GetFullPath() ); lowerTxt.Printf( _( "File '%s' saved." ), pcbFileName.GetFullPath() );
SetStatusText( lowerTxt, 0 ); SetStatusText( lowerTxt, 0 );
@ -1074,9 +1071,8 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName, bool aCreateProject
if( !IsWritable( pcbFileName ) ) if( !IsWritable( pcbFileName ) )
{ {
wxString msg = wxString::Format( _( wxString msg = wxString::Format( _( "No access rights to write to file '%s'." ),
"No access rights to write to file \"%s\"" ), pcbFileName.GetFullPath() );
pcbFileName.GetFullPath() );
DisplayError( this, msg ); DisplayError( this, msg );
return false; return false;
@ -1094,8 +1090,9 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName, bool aCreateProject
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
wxString msg = wxString::Format( _( "Error saving board file \"%s\".\n%s" ), wxString msg = wxString::Format( _( "Error saving board file '%s'.\n%s" ),
pcbFileName.GetFullPath(), ioe.What() ); pcbFileName.GetFullPath(),
ioe.What() );
DisplayError( this, msg ); DisplayError( this, msg );
return false; return false;