diff --git a/eeschema/dialogs/dialog_sch_sheet_props.cpp b/eeschema/dialogs/dialog_sch_sheet_props.cpp index ee63a75c31..7f5276a925 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props.cpp @@ -274,7 +274,7 @@ bool DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow() bool filename_changed = oldFilename != newRelativeFilename; - if( filename_changed ) + if( filename_changed || m_sheet->IsNew() ) { if( !onSheetFilenameChanged( newRelativeFilename ) ) return false; diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index a1201c21ae..42dfe55462 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -996,13 +996,15 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - sheet = new SCH_SHEET( - m_frame->GetCurrentSheet().Last(), static_cast( cursorPos ) ); + sheet = new SCH_SHEET( m_frame->GetCurrentSheet().Last(), + static_cast( cursorPos ) ); sheet->SetFlags( IS_NEW | IS_RESIZED ); sheet->SetScreen( NULL ); sheet->SetBorderWidth( cfg->m_Drawing.default_line_thickness ); sheet->SetBorderColor( cfg->m_Drawing.default_sheet_border_color ); sheet->SetBackgroundColor( cfg->m_Drawing.default_sheet_background_color ); + sheet->GetFields()[ SHEETNAME ].SetText( _( "Untitled Sheet" ) ); + sheet->GetFields()[ SHEETFILENAME ].SetText( _( "untitled.kicad_sch" ) ); sizeSheet( sheet, cursorPos ); m_view->ClearPreview(); @@ -1016,8 +1018,8 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) getViewControls()->SetAutoPan( false ); getViewControls()->CaptureCursor( false ); - if( m_frame->EditSheetProperties( - static_cast( sheet ), &m_frame->GetCurrentSheet(), nullptr ) ) + if( m_frame->EditSheetProperties( static_cast( sheet ), + &m_frame->GetCurrentSheet(), nullptr ) ) { sheet->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );