Formatting.

This commit is contained in:
Jeff Young 2021-10-01 21:49:14 +01:00
parent f606679164
commit 5f5ee7335d
9 changed files with 39 additions and 25 deletions

View File

@ -753,7 +753,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
if( m_dataModel->IsEdited() )
{
if( HandleUnsavedChanges( this, _( "Save changes?" ),
[&]()->bool
[&]() -> bool
{
if( TransferDataFromWindow() )
{

View File

@ -1202,7 +1202,7 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnClose( wxCloseEvent& event )
if( m_dataModel->IsEdited() )
{
if( !HandleUnsavedChanges( this, _( "Save changes?" ),
[&]()->bool
[&]() -> bool
{
return TransferDataFromWindow();
} ) )

View File

@ -1242,7 +1242,10 @@ bool SCH_EDIT_FRAME::AskToSaveChanges()
{
if( !HandleUnsavedChanges( this, _( "The current schematic has been modified. "
"Save changes?" ),
[&]()->bool { return SaveProject(); } ) )
[&]() -> bool
{
return SaveProject();
} ) )
{
return false;
}

View File

@ -654,7 +654,10 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
wxString msg = _( "Save changes to '%s' before closing?" );
if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ),
[&]()->bool { return SaveProject(); } ) )
[&]() -> bool
{
return SaveProject();
} ) )
{
return false;
}

View File

@ -1598,13 +1598,14 @@ bool SIM_PLOT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
filename.SetFullName( Prj().GetProjectName() + wxT( ".wbk" ) );
}
wxString fullFilename = filename.GetFullName();
wxString msg = _( "Save changes to '%s' before closing?" );
return HandleUnsavedChanges( this, wxString::Format( msg, filename.GetFullName() ),
[&]()->bool
{
return saveWorkbook( Prj().AbsolutePath( filename.GetFullName() ) );
} );
return HandleUnsavedChanges( this, wxString::Format( msg, fullFilename ),
[&]() -> bool
{
return saveWorkbook( Prj().AbsolutePath( fullFilename ) );
} );
}
return true;

View File

@ -525,7 +525,7 @@ public:
private:
///< Helper screen used when no symbol is loaded
SCH_SCREEN* m_dummyScreen;
SCH_SCREEN* m_dummyScreen;
LIB_SYMBOL* m_symbol; // a symbol I own, it is not in any library, but a
// copy could be.
@ -536,20 +536,16 @@ private:
SYMBOL_EDITOR_SETTINGS* m_settings; // Handle to the settings
// The unit number to edit and show
int m_unit;
int m_unit;
// Show the normal shape ( m_convert <= 1 ) or the converted shape ( m_convert > 1 )
int m_convert;
int m_convert;
///< Flag if the symbol being edited was loaded directly from a schematic.
bool m_isSymbolFromSchematic;
bool m_isSymbolFromSchematic;
/**
* The reference of the symbol.
*
* @note This is only valid when the current symbol was loaded from the schematic.
*/
wxString m_reference;
///< RefDes of the symbol (only valid if symbol was loaded from schematic)
wxString m_reference;
// True to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded symbol has graphic items for converted shape

View File

@ -259,9 +259,11 @@ bool SYMBOL_EDIT_FRAME::LoadSymbol( const LIB_ID& aLibId, int aUnit, int aConver
if( GetScreen()->IsContentModified() && GetCurSymbol() )
{
if( !HandleUnsavedChanges( this, _( "The current symbol has been modified. "
"Save changes?" ),
[&]()->bool { return saveCurrentSymbol(); } ) )
if( !HandleUnsavedChanges( this, _( "The current symbol has been modified. Save changes?" ),
[&]() -> bool
{
return saveCurrentSymbol();
} ) )
{
return false;
}

View File

@ -60,7 +60,10 @@ void PL_EDITOR_FRAME::OnFileHistory( wxCommandEvent& event )
{
if( !HandleUnsavedChanges( this, _( "The current drawing sheet has been modified. "
"Save changes?" ),
[&]()->bool { return saveCurrentPageLayout(); } ) )
[&]() -> bool
{
return saveCurrentPageLayout();
} ) )
{
return;
}
@ -101,7 +104,10 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
{
if( !HandleUnsavedChanges( this, _( "The current drawing sheet has been modified. "
"Save changes?" ),
[&]()->bool { return saveCurrentPageLayout(); } ) )
[&]() -> bool
{
return saveCurrentPageLayout();
} ) )
{
return;
}

View File

@ -586,7 +586,10 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
if( IsContentModified() )
{
if( !HandleUnsavedChanges( this, _( "The current PCB has been modified. Save changes?" ),
[&]()->bool { return SavePcbFile( GetBoard()->GetFileName() ); } ) )
[&]() -> bool
{
return SavePcbFile( GetBoard()->GetFileName() );
} ) )
{
return false;
}