Application title bar: app name after filename

Fixes https://gitlab.com/kicad/code/kicad/issues/2096
This commit is contained in:
Michael Kavanagh 2020-04-13 21:02:35 +01:00 committed by Seth Hillbrand
parent 04ba129881
commit de03d3d427
9 changed files with 35 additions and 31 deletions

View File

@ -894,7 +894,7 @@ void LIB_VIEW_FRAME::DisplayLibInfos()
{
const SYMBOL_LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRow( m_libraryName );
wxString title = wxString::Format( _( "Symbol Library Browser -- %s" ),
wxString title = wxString::Format( wxT( "%s \u2014 " ) + _( "Symbol Library Browser" ),
row ? row->GetFullURI() : _( "no library selected" ) );
SetTitle( title );
}

View File

@ -49,22 +49,23 @@
void LIB_EDIT_FRAME::updateTitle()
{
wxString lib = GetCurLib();
wxString title = _( "Symbol Editor" );
wxString title;
if( IsSymbolFromSchematic() )
{
title += wxT( " \u2014 " );
title += wxString::Format( _( "%s from schematic" ), m_reference );
title += wxT( " \u2014 " );
}
else
{
if( GetCurPart() )
title += wxT( " \u2014 " ) + GetCurPart()->GetLibId().Format();
title += GetCurPart()->GetLibId().Format() + wxT( " \u2014 " ) ;
if( GetCurPart() && m_libMgr && m_libMgr->IsLibraryReadOnly( GetCurLib() ) )
title += wxT( " \u2014 " ) + _( "[Read Only Library]" );
title += _( "[Read Only Library]" ) + wxT( " \u2014 " );
}
title += _( "Symbol Editor" );
SetTitle( title );
}

View File

@ -1099,25 +1099,27 @@ void SCH_EDIT_FRAME::UpdateTitle()
if( GetScreen()->GetFileName().IsEmpty() )
{
title.Printf( _( "Eeschema" ) + wxT( " \u2014" ) + _( " [no file]" ) );
title.Printf( _( "[no file]" ) + wxT( " \u2014 " ) + _( "Eeschema" ) );
}
else
{
wxString fileName = Prj().AbsolutePath( GetScreen()->GetFileName() );
wxFileName fn = fileName;
title.Printf( _( "Eeschema" ) + wxT( " \u2014 %s [%s] \u2014 %s" ),
fn.GetFullName(),
GetCurrentSheet().PathHumanReadable(),
fn.GetPath() );
wxString append;
if( fn.FileExists() )
{
if( !fn.IsFileWritable() )
title += _( " [Read Only]" );
append = _( "[Read Only] " );
}
else
title += _( " [no file]" );
append = _( "[no file] " );
title.Printf( wxT( "%s [%s] \u2014 %s %s\u2014 " ) + _( "Eeschema" ),
fn.GetFullName(),
GetCurrentSheet().PathHumanReadable(),
fn.GetPath(),
append );
}
SetTitle( title );

View File

@ -714,7 +714,7 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
else
{
wxString title;
title.Printf( _( "GerbView" ) + wxT( " \u2014 %s%s" ),
title.Printf( wxT( "%s%s \u2014 " ) + _( "GerbView" ),
gerber->m_FileName,
gerber->m_IsX2_file ? _( " (with X2 attributes)" )
: wxString( wxEmptyString ) );

View File

@ -592,24 +592,24 @@ void KICAD_MANAGER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTex
void KICAD_MANAGER_FRAME::ProjectChanged()
{
wxString title = wxS( "KiCad " ) + GetBuildVersion();
wxString app = wxS( "KiCad " ) + GetMajorMinorVersion();
wxString file = GetProjectFileName();
wxString title;
if( !file.IsEmpty() )
{
// Ensure file name is absolute
wxFileName fn( file );
if( !fn.IsAbsolute() )
fn.MakeAbsolute();
title += " ";
title += fn.GetFullPath();
title += fn.GetName();
if( !fn.IsDirWritable() )
title += _( " [Read Only]" );
title += wxS(" \u2014 ");
}
title += app;
SetTitle( title );
}

View File

@ -531,7 +531,7 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo()
wxString title;
wxString file = GetCurrentFileName();
title.Printf( _( "Page Layout Editor" ) + wxT( " \u2014 %s" ),
title.Printf( wxT( "%s \u2014 " ) + _( "Page Layout Editor" ),
file.Length() ? file : _( "no file selected" ) );
SetTitle( title );
}

View File

@ -696,13 +696,13 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
void FOOTPRINT_EDIT_FRAME::updateTitle()
{
wxString title = _( "Footprint Editor" );
wxString title;
LIB_ID fpid = GetLoadedFPID();
bool writable = true;
if( IsCurrentFPFromBoard() )
{
title += wxString::Format( wxT( " \u2014 %s [from %s.%s]" ),
title += wxString::Format( _( "%s [from %s.%s]" ) + wxT( " \u2014 " ),
GetBoard()->GetFirstModule()->GetReference(), Prj().GetProjectName(),
PcbFileExtension );
}
@ -718,18 +718,20 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
}
// Note: don't used GetLoadedFPID(); footprint name may have been edited
title += wxString::Format( wxT( " \u2014 %s %s" ),
title += wxString::Format( wxT( "%s %s \u2014 " ),
FROM_UTF8( GetBoard()->GetFirstModule()->GetFPID().Format().c_str() ),
writable ? wxString( wxEmptyString ) : _( "[Read Only]" ) );
}
else if( !fpid.GetLibItemName().empty() )
{
// Note: don't used GetLoadedFPID(); footprint name may have been edited
title += wxString::Format( wxT( " \u2014 %s %s" ),
title += wxString::Format( wxT( "%s %s \u2014 " ),
FROM_UTF8( GetBoard()->GetFirstModule()->GetFPID().GetLibItemName().c_str() ),
_( "[Unsaved]" ) );
}
title += _( "Footprint Editor" );
SetTitle( title );
}
@ -1073,5 +1075,3 @@ void FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng( wxCommandEvent& event )
wxYield();
SaveCanvasImageToFile( this, dlg.GetPath() );
}

View File

@ -977,8 +977,7 @@ void FOOTPRINT_VIEWER_FRAME::UpdateTitle()
wxString title;
wxString path;
title.Printf( _( "Footprint Library Browser" ) + L" \u2014 %s",
getCurNickname().IsEmpty() ? _( "no library selected" ) : getCurNickname() );
title.Printf( getCurNickname().IsEmpty() ? _( "no library selected" ) : getCurNickname() );
// Now, add the full path, for info
if( !getCurNickname().IsEmpty() )
@ -990,6 +989,8 @@ void FOOTPRINT_VIEWER_FRAME::UpdateTitle()
title << L" \u2014 " << row->GetFullURI( true );
}
title += wxT( " \u2014 " ) + _( "Footprint Library Browser" );
SetTitle( title );
}

View File

@ -1154,7 +1154,7 @@ void PCB_EDIT_FRAME::UpdateTitle()
else
fileinfo = _( " [Unsaved]" );
SetTitle( wxString::Format( _( "Pcbnew" ) + wxT( " \u2014 %s%s" ),
SetTitle( wxString::Format( wxT( "%s%s \u2014 " ) + _( "Pcbnew" ),
fileName.GetFullPath(),
fileinfo ) );
}