Workaround a few more OSX printf problems.
Also regularizes the frame title processing. Also fixes a type where the library name wasn't processed for variable expansion. Fixes https://gitlab.com/kicad/code/kicad/issues/7742
This commit is contained in:
parent
99da3d1336
commit
685ee31c35
|
@ -1249,11 +1249,7 @@ void SCH_EDIT_FRAME::UpdateTitle()
|
||||||
{
|
{
|
||||||
wxString title;
|
wxString title;
|
||||||
|
|
||||||
if( GetScreen()->GetFileName().IsEmpty() )
|
if( !GetScreen()->GetFileName().IsEmpty() )
|
||||||
{
|
|
||||||
title = _( "[no file]" ) + wxT( " \u2014 " ) + _( "Schematic Editor" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
wxFileName fn( Prj().AbsolutePath( GetScreen()->GetFileName() ) );
|
wxFileName fn( Prj().AbsolutePath( GetScreen()->GetFileName() ) );
|
||||||
bool readOnly = false;
|
bool readOnly = false;
|
||||||
|
@ -1264,12 +1260,24 @@ void SCH_EDIT_FRAME::UpdateTitle()
|
||||||
else
|
else
|
||||||
unsaved = true;
|
unsaved = true;
|
||||||
|
|
||||||
title = ( IsContentModified() ? "*" : "" )
|
if( IsContentModified() )
|
||||||
+ fn.GetName() + " [" + GetCurrentSheet().PathHumanReadable( false ) + "] "
|
title = wxT( "*" );
|
||||||
+ ( readOnly ? _( "[Read Only]" ) + wxS( " " ) : wxS( "" ) )
|
|
||||||
+ ( unsaved ? _( "[Unsaved]" ) + wxS( " " ) : wxS( "" ) )
|
title += fn.GetName();
|
||||||
+ wxT( "\u2014 " ) + _( "Schematic Editor" );
|
title += wxString::Format( wxT( " [%s]" ), GetCurrentSheet().PathHumanReadable( false ) );
|
||||||
|
|
||||||
|
if( readOnly )
|
||||||
|
title += wxS( " " ) + _( "[Read Only]" );
|
||||||
|
|
||||||
|
if( unsaved )
|
||||||
|
title += wxS( " " ) + _( "[Unsaved]" );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
title = _( "[no schematic loaded]" );
|
||||||
|
}
|
||||||
|
|
||||||
|
title += wxT( " \u2014 " ) + _( "Schematic Editor" );
|
||||||
|
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,11 +333,22 @@ void SIM_PLOT_FRAME::updateTitle()
|
||||||
else
|
else
|
||||||
unsaved = true;
|
unsaved = true;
|
||||||
|
|
||||||
SetTitle( wxString::Format( wxT( "%s%s %s%s\u2014 " ) + _( "Spice Simulator" ),
|
wxString title;
|
||||||
m_workbook->IsModified() ? "*" : "",
|
|
||||||
filename.GetName(),
|
if( m_workbook->IsModified() )
|
||||||
readOnly ? _( "[Read Only]" ) + wxS( " " ) : "",
|
title = wxT( "*" ) + filename.GetName();
|
||||||
unsaved ? _( "[Unsaved]" ) + wxS( " " ) : "" ) );
|
else
|
||||||
|
title = filename.GetName();
|
||||||
|
|
||||||
|
if( readOnly )
|
||||||
|
title += wxS( " " ) + _( "[Read Only]" );
|
||||||
|
|
||||||
|
if( unsaved )
|
||||||
|
title += wxS( " " ) + _( "[Unsaved]" );
|
||||||
|
|
||||||
|
title += wxT( " \u2014 " ) + _( "Spice Simulator" );
|
||||||
|
|
||||||
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -139,26 +139,28 @@ void SYMBOL_EDIT_FRAME::updateTitle()
|
||||||
|
|
||||||
if( IsSymbolFromSchematic() )
|
if( IsSymbolFromSchematic() )
|
||||||
{
|
{
|
||||||
title = ( GetScreen() && GetScreen()->IsContentModified() ? "*" : "" )
|
if( GetScreen() && GetScreen()->IsContentModified() )
|
||||||
+ m_reference + " "
|
title = wxT( "*" );
|
||||||
+ _( "[from schematic]" )
|
|
||||||
+ wxT( " \u2014 " );
|
title += m_reference;
|
||||||
|
title += wxS( " " ) + _( "[from schematic]" );
|
||||||
|
}
|
||||||
|
else if( GetCurSymbol() )
|
||||||
|
{
|
||||||
|
if( GetScreen() && GetScreen()->IsContentModified() )
|
||||||
|
title = wxT( "*" );
|
||||||
|
|
||||||
|
title += FROM_UTF8( GetCurSymbol()->GetLibId().Format().c_str() );
|
||||||
|
|
||||||
|
if( m_libMgr && m_libMgr->IsLibraryReadOnly( GetCurLib() ) )
|
||||||
|
title += wxS( " " ) + _( "[Read Only Library]" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( GetCurSymbol() )
|
title = _( "[no symbol loaded]" );
|
||||||
{
|
|
||||||
bool readOnly = m_libMgr && m_libMgr->IsLibraryReadOnly( GetCurLib() );
|
|
||||||
|
|
||||||
title = ( GetScreen() && GetScreen()->IsContentModified() ? "*" : "" )
|
|
||||||
+ FROM_UTF8( GetCurSymbol()->GetLibId().Format().c_str() )
|
|
||||||
+ " "
|
|
||||||
+ ( readOnly ? _( "[Read Only Library]" ) + wxT( " " ) : "" )
|
|
||||||
+ wxT( " \u2014 " );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
title += _( "Symbol Editor" );
|
title += wxT( " \u2014 " ) + _( "Symbol Editor" );
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -901,8 +901,9 @@ void SYMBOL_VIEWER_FRAME::DisplayLibInfos()
|
||||||
{
|
{
|
||||||
const SYMBOL_LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRow( m_libraryName, true );
|
const SYMBOL_LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRow( m_libraryName, true );
|
||||||
|
|
||||||
wxString title = wxString::Format( wxT( "%s \u2014 " ) + _( "Symbol Library Browser" ),
|
wxString title = row ? row->GetFullURI( true ) : _( "[no library selected]" );
|
||||||
row ? row->GetFullURI() : _( "no library selected" ) );
|
|
||||||
|
title += wxT( " \u2014 " ) + _( "Symbol Library Browser" );
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -621,13 +621,15 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxString title;
|
wxString title;
|
||||||
wxFileName filename( gerber->m_FileName );
|
wxFileName filename( gerber->m_FileName );
|
||||||
|
|
||||||
title.Printf( wxT( "%s%s \u2014 " ) + _( "Gerber Viewer" ),
|
title = filename.GetFullName();
|
||||||
filename.GetFullName(),
|
|
||||||
gerber->m_IsX2_file ? wxS( " " ) + _( "(with X2 attributes)" )
|
if( gerber->m_IsX2_file )
|
||||||
: wxString( wxEmptyString ) );
|
title += wxS( " " ) + _( "(with X2 attributes)" );
|
||||||
|
|
||||||
|
title += wxT( " \u2014 " ) + _( "Gerber Viewer" );
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
|
|
||||||
gerber->DisplayImageInfo( this );
|
gerber->DisplayImageInfo( this );
|
||||||
|
|
|
@ -605,7 +605,6 @@ void KICAD_MANAGER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTex
|
||||||
|
|
||||||
void KICAD_MANAGER_FRAME::ProjectChanged()
|
void KICAD_MANAGER_FRAME::ProjectChanged()
|
||||||
{
|
{
|
||||||
wxString app = wxS( "KiCad " ) + GetMajorMinorVersion();
|
|
||||||
wxString file = GetProjectFileName();
|
wxString file = GetProjectFileName();
|
||||||
wxString title;
|
wxString title;
|
||||||
|
|
||||||
|
@ -613,15 +612,17 @@ void KICAD_MANAGER_FRAME::ProjectChanged()
|
||||||
{
|
{
|
||||||
wxFileName fn( file );
|
wxFileName fn( file );
|
||||||
|
|
||||||
title += fn.GetName();
|
title = fn.GetName();
|
||||||
|
|
||||||
if( !fn.IsDirWritable() )
|
if( !fn.IsDirWritable() )
|
||||||
title += wxS( " " ) + _( "[Read Only]" );
|
title += wxS( " " ) + _( "[Read Only]" );
|
||||||
|
}
|
||||||
title += wxS(" \u2014 ");
|
else
|
||||||
|
{
|
||||||
|
title = _( "[no project loaded]" );
|
||||||
}
|
}
|
||||||
|
|
||||||
title += app;
|
title += wxT( " \u2014 " ) + _( "KiCad " ) + GetMajorMinorVersion();
|
||||||
|
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
|
@ -547,8 +547,13 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo()
|
||||||
wxString title;
|
wxString title;
|
||||||
wxFileName file( GetCurrentFileName() );
|
wxFileName file( GetCurrentFileName() );
|
||||||
|
|
||||||
title.Printf( wxT( "%s \u2014 " ) + _( "Drawing Sheet Editor" ),
|
if( file.IsOk() )
|
||||||
file.IsOk() ? file.GetName() : _( "no file selected" ) );
|
title = file.GetName();
|
||||||
|
else
|
||||||
|
title = _( "[no drawing sheet loaded]" );
|
||||||
|
|
||||||
|
title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ),
|
||||||
|
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -756,9 +756,12 @@ void FOOTPRINT_EDIT_FRAME::UpdateTitle()
|
||||||
|
|
||||||
if( IsCurrentFPFromBoard() )
|
if( IsCurrentFPFromBoard() )
|
||||||
{
|
{
|
||||||
title = ( IsContentModified() ? "*" : "" )
|
if( IsContentModified() )
|
||||||
+ footprint->GetReference() + wxS( " [" ) + _( "from" ) + " "
|
title = wxT( "*" );
|
||||||
+ Prj().GetProjectName() + "." + PcbFileExtension + wxS( "] \u2014 " );
|
|
||||||
|
title += footprint->GetReference();
|
||||||
|
title += wxS( " " ) + wxString::Format( _( "[from %s]" ),
|
||||||
|
Prj().GetProjectName() + "." + PcbFileExtension );
|
||||||
}
|
}
|
||||||
else if( fpid.IsValid() )
|
else if( fpid.IsValid() )
|
||||||
{
|
{
|
||||||
|
@ -772,19 +775,29 @@ void FOOTPRINT_EDIT_FRAME::UpdateTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: don't used GetLoadedFPID(); footprint name may have been edited
|
// Note: don't used GetLoadedFPID(); footprint name may have been edited
|
||||||
title = ( IsContentModified() ? "*" : "" )
|
if( IsContentModified() )
|
||||||
+ FROM_UTF8( footprint->GetFPID().Format().c_str() ) + " "
|
title = wxT( "*" );
|
||||||
+ ( writable ? wxS( "" ) : _( "[Read Only]" ) + wxS( " " ) ) + wxS( "\u2014 " );
|
|
||||||
|
title += FROM_UTF8( footprint->GetFPID().Format().c_str() );
|
||||||
|
|
||||||
|
if( !writable )
|
||||||
|
title += wxS( " " ) + _( "[Read Only]" );
|
||||||
}
|
}
|
||||||
else if( !fpid.GetLibItemName().empty() )
|
else if( !fpid.GetLibItemName().empty() )
|
||||||
{
|
{
|
||||||
// Note: don't used GetLoadedFPID(); footprint name may have been edited
|
// Note: don't used GetLoadedFPID(); footprint name may have been edited
|
||||||
title = ( IsContentModified() ? "*" : "" )
|
if( IsContentModified() )
|
||||||
+ FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() ) + " "
|
title = wxT( "*" );
|
||||||
+ _( "[Unsaved]" ) + wxS( " \u2014 " );
|
|
||||||
|
title += FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() );
|
||||||
|
title += wxS( " " ) + _( "[Unsaved]" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
title = _( "[no footprint loaded]" );
|
||||||
}
|
}
|
||||||
|
|
||||||
title += _( "Footprint Editor" );
|
title += wxT( " \u2014 " ) + _( "Footprint Editor" );
|
||||||
|
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
|
@ -977,8 +977,7 @@ bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent
|
||||||
|
|
||||||
void FOOTPRINT_VIEWER_FRAME::Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle )
|
void FOOTPRINT_VIEWER_FRAME::Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle )
|
||||||
{
|
{
|
||||||
wxString title = wxString::Format( _( "3D Viewer" ) + wxT( " \u2014 %s" ),
|
wxString title = _( "3D Viewer" ) + wxT( " \u2014 " ) + getCurFootprintName();
|
||||||
getCurFootprintName() );
|
|
||||||
PCB_BASE_FRAME::Update3DView( aMarkDirty, aRefresh, &title );
|
PCB_BASE_FRAME::Update3DView( aMarkDirty, aRefresh, &title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,16 +1012,19 @@ void FOOTPRINT_VIEWER_FRAME::UpdateTitle()
|
||||||
wxString title;
|
wxString title;
|
||||||
wxString path;
|
wxString path;
|
||||||
|
|
||||||
title.Printf( getCurNickname().IsEmpty() ? _( "no library selected" ) : getCurNickname() );
|
|
||||||
|
|
||||||
// Now, add the full path, for info
|
|
||||||
if( !getCurNickname().IsEmpty() )
|
if( !getCurNickname().IsEmpty() )
|
||||||
{
|
{
|
||||||
|
title = getCurNickname();
|
||||||
|
|
||||||
FP_LIB_TABLE* libtable = Prj().PcbFootprintLibs();
|
FP_LIB_TABLE* libtable = Prj().PcbFootprintLibs();
|
||||||
const LIB_TABLE_ROW* row = libtable->FindRow( getCurNickname() );
|
const LIB_TABLE_ROW* row = libtable->FindRow( getCurNickname() );
|
||||||
|
|
||||||
if( row )
|
if( row )
|
||||||
title << L" \u2014 " << row->GetFullURI( true );
|
title += wxT( " \u2014 " ) + row->GetFullURI( true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
title = _( "[no library selected]" );
|
||||||
}
|
}
|
||||||
|
|
||||||
title += wxT( " \u2014 " ) + _( "Footprint Library Browser" );
|
title += wxT( " \u2014 " ) + _( "Footprint Library Browser" );
|
||||||
|
|
|
@ -1245,11 +1245,19 @@ void PCB_EDIT_FRAME::UpdateTitle()
|
||||||
|
|
||||||
wxString title;
|
wxString title;
|
||||||
|
|
||||||
title = ( IsContentModified() ? "*" : "" )
|
if( IsContentModified() )
|
||||||
+ fn.GetName() + " "
|
title = wxT( "*" );
|
||||||
+ ( readOnly ? _( "[Read Only]" ) + wxS( " " ) : wxS( "" ) )
|
|
||||||
+ ( unsaved ? _( "[Unsaved]" ) + wxS( " " ) : wxS( "" ) )
|
title += fn.GetName();
|
||||||
+ wxT( "\u2014 " ) + _( "PCB Editor" );
|
|
||||||
|
if( readOnly )
|
||||||
|
title += wxS( " " ) + _( "[Read Only]" );
|
||||||
|
|
||||||
|
if( unsaved )
|
||||||
|
title += wxS( " " ) + _( "[Unsaved]" );
|
||||||
|
|
||||||
|
title += wxT( " \u2014 " ) + _( "PCB Editor" );
|
||||||
|
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue