Browse Source

Formatting.

6.0.7
Jeff Young 4 years ago
parent
commit
5f5ee7335d
  1. 2
      eeschema/dialogs/dialog_lib_edit_pin_table.cpp
  2. 2
      eeschema/dialogs/dialog_symbol_fields_table.cpp
  3. 5
      eeschema/files-io.cpp
  4. 5
      eeschema/sch_edit_frame.cpp
  5. 11
      eeschema/sim/sim_plot_frame.cpp
  6. 16
      eeschema/symbol_editor/symbol_edit_frame.h
  7. 8
      eeschema/symbol_editor/symbol_editor.cpp
  8. 10
      pagelayout_editor/files.cpp
  9. 5
      pcbnew/files.cpp

2
eeschema/dialogs/dialog_lib_edit_pin_table.cpp

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

2
eeschema/dialogs/dialog_symbol_fields_table.cpp

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

5
eeschema/files-io.cpp

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

5
eeschema/sch_edit_frame.cpp

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

11
eeschema/sim/sim_plot_frame.cpp

@ -1598,13 +1598,14 @@ bool SIM_PLOT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
filename.SetFullName( Prj().GetProjectName() + wxT( ".wbk" ) ); filename.SetFullName( Prj().GetProjectName() + wxT( ".wbk" ) );
} }
wxString fullFilename = filename.GetFullName();
wxString msg = _( "Save changes to '%s' before closing?" ); 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; return true;

16
eeschema/symbol_editor/symbol_edit_frame.h

@ -525,7 +525,7 @@ public:
private: private:
///< Helper screen used when no symbol is loaded ///< 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 LIB_SYMBOL* m_symbol; // a symbol I own, it is not in any library, but a
// copy could be. // copy could be.
@ -536,20 +536,16 @@ private:
SYMBOL_EDITOR_SETTINGS* m_settings; // Handle to the settings SYMBOL_EDITOR_SETTINGS* m_settings; // Handle to the settings
// The unit number to edit and show // 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 ) // 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. ///< 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. // True to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded symbol has graphic items for converted shape // They are enabled when the loaded symbol has graphic items for converted shape

8
eeschema/symbol_editor/symbol_editor.cpp

@ -259,9 +259,11 @@ bool SYMBOL_EDIT_FRAME::LoadSymbol( const LIB_ID& aLibId, int aUnit, int aConver
if( GetScreen()->IsContentModified() && GetCurSymbol() ) 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; return false;
} }

10
pagelayout_editor/files.cpp

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

5
pcbnew/files.cpp

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

Loading…
Cancel
Save