pagelayout_editor: display a '*' in title frame if there are changes.

This commit is contained in:
jean-pierre charras 2023-02-07 17:34:46 +01:00
parent 77d4704b45
commit d2ce3ce381
2 changed files with 20 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
@ -349,6 +349,18 @@ bool PL_EDITOR_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, i
}
void PL_EDITOR_FRAME::OnModify()
{
// Must be called after a change in order to set the "modify" flag and update
// the frame title.
EDA_BASE_FRAME::OnModify();
GetScreen()->SetContentModified();
UpdateTitleAndInfo();
}
bool PL_EDITOR_FRAME::IsContentModified() const
{
return GetScreen() && GetScreen()->IsContentModified();
@ -542,10 +554,13 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo()
wxString title;
wxFileName file( GetCurrentFileName() );
if( IsContentModified() )
title = wxT( "*" );
if( file.IsOk() )
title = file.GetName();
title += file.GetName();
else
title = _( "[no drawing sheet loaded]" );
title += _( "[no drawing sheet loaded]" );
title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ),

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
@ -235,12 +235,7 @@ public:
/**
* Must be called after a change in order to set the "modify" flag.
*/
void OnModify() override
{
EDA_BASE_FRAME::OnModify();
GetScreen()->SetContentModified();
}
void OnModify() override;
/**
* Save a copy of the description (in a S expr string) for Undo/redo commands.