pagelayout_editor: display a '*' in title frame if there are changes.
This commit is contained in:
parent
77d4704b45
commit
d2ce3ce381
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 CERN
|
* 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
|
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* 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
|
bool PL_EDITOR_FRAME::IsContentModified() const
|
||||||
{
|
{
|
||||||
return GetScreen() && GetScreen()->IsContentModified();
|
return GetScreen() && GetScreen()->IsContentModified();
|
||||||
|
@ -542,10 +554,13 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo()
|
||||||
wxString title;
|
wxString title;
|
||||||
wxFileName file( GetCurrentFileName() );
|
wxFileName file( GetCurrentFileName() );
|
||||||
|
|
||||||
|
if( IsContentModified() )
|
||||||
|
title = wxT( "*" );
|
||||||
|
|
||||||
if( file.IsOk() )
|
if( file.IsOk() )
|
||||||
title = file.GetName();
|
title += file.GetName();
|
||||||
else
|
else
|
||||||
title = _( "[no drawing sheet loaded]" );
|
title += _( "[no drawing sheet loaded]" );
|
||||||
|
|
||||||
title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ),
|
title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ),
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 CERN
|
* 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
|
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* 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.
|
* Must be called after a change in order to set the "modify" flag.
|
||||||
*/
|
*/
|
||||||
void OnModify() override
|
void OnModify() override;
|
||||||
{
|
|
||||||
EDA_BASE_FRAME::OnModify();
|
|
||||||
|
|
||||||
GetScreen()->SetContentModified();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save a copy of the description (in a S expr string) for Undo/redo commands.
|
* Save a copy of the description (in a S expr string) for Undo/redo commands.
|
||||||
|
|
Loading…
Reference in New Issue