diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index d7722398f1..3782d92c00 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1249,11 +1249,7 @@ void SCH_EDIT_FRAME::UpdateTitle() { wxString title; - if( GetScreen()->GetFileName().IsEmpty() ) - { - title = _( "[no file]" ) + wxT( " \u2014 " ) + _( "Schematic Editor" ); - } - else + if( !GetScreen()->GetFileName().IsEmpty() ) { wxFileName fn( Prj().AbsolutePath( GetScreen()->GetFileName() ) ); bool readOnly = false; @@ -1264,12 +1260,24 @@ void SCH_EDIT_FRAME::UpdateTitle() else unsaved = true; - title = ( IsContentModified() ? "*" : "" ) - + fn.GetName() + " [" + GetCurrentSheet().PathHumanReadable( false ) + "] " - + ( readOnly ? _( "[Read Only]" ) + wxS( " " ) : wxS( "" ) ) - + ( unsaved ? _( "[Unsaved]" ) + wxS( " " ) : wxS( "" ) ) - + wxT( "\u2014 " ) + _( "Schematic Editor" ); + if( IsContentModified() ) + title = wxT( "*" ); + + title += fn.GetName(); + 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 ); } diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index c768b790cb..6c9eb77c43 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -333,11 +333,22 @@ void SIM_PLOT_FRAME::updateTitle() else unsaved = true; - SetTitle( wxString::Format( wxT( "%s%s %s%s\u2014 " ) + _( "Spice Simulator" ), - m_workbook->IsModified() ? "*" : "", - filename.GetName(), - readOnly ? _( "[Read Only]" ) + wxS( " " ) : "", - unsaved ? _( "[Unsaved]" ) + wxS( " " ) : "" ) ); + wxString title; + + if( m_workbook->IsModified() ) + title = wxT( "*" ) + filename.GetName(); + else + title = filename.GetName(); + + if( readOnly ) + title += wxS( " " ) + _( "[Read Only]" ); + + if( unsaved ) + title += wxS( " " ) + _( "[Unsaved]" ); + + title += wxT( " \u2014 " ) + _( "Spice Simulator" ); + + SetTitle( title ); } diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 8f0822fcf0..d58728bf81 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -139,26 +139,28 @@ void SYMBOL_EDIT_FRAME::updateTitle() if( IsSymbolFromSchematic() ) { - title = ( GetScreen() && GetScreen()->IsContentModified() ? "*" : "" ) - + m_reference + " " - + _( "[from schematic]" ) - + wxT( " \u2014 " ); + if( GetScreen() && GetScreen()->IsContentModified() ) + title = wxT( "*" ); + + 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 { - if( GetCurSymbol() ) - { - 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 = _( "[no symbol loaded]" ); } - title += _( "Symbol Editor" ); + title += wxT( " \u2014 " ) + _( "Symbol Editor" ); SetTitle( title ); } diff --git a/eeschema/symbol_viewer_frame.cpp b/eeschema/symbol_viewer_frame.cpp index b7444bf157..bd32eede4d 100644 --- a/eeschema/symbol_viewer_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -901,8 +901,9 @@ void SYMBOL_VIEWER_FRAME::DisplayLibInfos() { const SYMBOL_LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRow( m_libraryName, true ); - wxString title = wxString::Format( wxT( "%s \u2014 " ) + _( "Symbol Library Browser" ), - row ? row->GetFullURI() : _( "no library selected" ) ); + wxString title = row ? row->GetFullURI( true ) : _( "[no library selected]" ); + + title += wxT( " \u2014 " ) + _( "Symbol Library Browser" ); SetTitle( title ); } } diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 9251e5a5c3..dee37696f3 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -621,13 +621,15 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo() } else { - wxString title; + wxString title; wxFileName filename( gerber->m_FileName ); - title.Printf( wxT( "%s%s \u2014 " ) + _( "Gerber Viewer" ), - filename.GetFullName(), - gerber->m_IsX2_file ? wxS( " " ) + _( "(with X2 attributes)" ) - : wxString( wxEmptyString ) ); + title = filename.GetFullName(); + + if( gerber->m_IsX2_file ) + title += wxS( " " ) + _( "(with X2 attributes)" ); + + title += wxT( " \u2014 " ) + _( "Gerber Viewer" ); SetTitle( title ); gerber->DisplayImageInfo( this ); diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 3749509f1b..7fe60de472 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -605,7 +605,6 @@ void KICAD_MANAGER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTex void KICAD_MANAGER_FRAME::ProjectChanged() { - wxString app = wxS( "KiCad " ) + GetMajorMinorVersion(); wxString file = GetProjectFileName(); wxString title; @@ -613,15 +612,17 @@ void KICAD_MANAGER_FRAME::ProjectChanged() { wxFileName fn( file ); - title += fn.GetName(); + title = fn.GetName(); if( !fn.IsDirWritable() ) title += wxS( " " ) + _( "[Read Only]" ); - - title += wxS(" \u2014 "); + } + else + { + title = _( "[no project loaded]" ); } - title += app; + title += wxT( " \u2014 " ) + _( "KiCad " ) + GetMajorMinorVersion(); SetTitle( title ); } diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 797f242792..8a7069321d 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -547,8 +547,13 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo() wxString title; wxFileName file( GetCurrentFileName() ); - title.Printf( wxT( "%s \u2014 " ) + _( "Drawing Sheet Editor" ), - file.IsOk() ? file.GetName() : _( "no file selected" ) ); + if( file.IsOk() ) + title = file.GetName(); + else + title = _( "[no drawing sheet loaded]" ); + + title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ), + SetTitle( title ); } diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 59fe456c78..f2273d6e55 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -756,9 +756,12 @@ void FOOTPRINT_EDIT_FRAME::UpdateTitle() if( IsCurrentFPFromBoard() ) { - title = ( IsContentModified() ? "*" : "" ) - + footprint->GetReference() + wxS( " [" ) + _( "from" ) + " " - + Prj().GetProjectName() + "." + PcbFileExtension + wxS( "] \u2014 " ); + if( IsContentModified() ) + title = wxT( "*" ); + + title += footprint->GetReference(); + title += wxS( " " ) + wxString::Format( _( "[from %s]" ), + Prj().GetProjectName() + "." + PcbFileExtension ); } else if( fpid.IsValid() ) { @@ -772,19 +775,29 @@ void FOOTPRINT_EDIT_FRAME::UpdateTitle() } // Note: don't used GetLoadedFPID(); footprint name may have been edited - title = ( IsContentModified() ? "*" : "" ) - + FROM_UTF8( footprint->GetFPID().Format().c_str() ) + " " - + ( writable ? wxS( "" ) : _( "[Read Only]" ) + wxS( " " ) ) + wxS( "\u2014 " ); + if( IsContentModified() ) + title = wxT( "*" ); + + title += FROM_UTF8( footprint->GetFPID().Format().c_str() ); + + if( !writable ) + title += wxS( " " ) + _( "[Read Only]" ); } else if( !fpid.GetLibItemName().empty() ) { // Note: don't used GetLoadedFPID(); footprint name may have been edited - title = ( IsContentModified() ? "*" : "" ) - + FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() ) + " " - + _( "[Unsaved]" ) + wxS( " \u2014 " ); + if( IsContentModified() ) + title = wxT( "*" ); + + 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 ); } diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 4c7bf8a9fe..69a45efe54 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -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 ) { - wxString title = wxString::Format( _( "3D Viewer" ) + wxT( " \u2014 %s" ), - getCurFootprintName() ); + wxString title = _( "3D Viewer" ) + wxT( " \u2014 " ) + getCurFootprintName(); PCB_BASE_FRAME::Update3DView( aMarkDirty, aRefresh, &title ); } @@ -1013,16 +1012,19 @@ void FOOTPRINT_VIEWER_FRAME::UpdateTitle() wxString title; wxString path; - title.Printf( getCurNickname().IsEmpty() ? _( "no library selected" ) : getCurNickname() ); - - // Now, add the full path, for info if( !getCurNickname().IsEmpty() ) { + title = getCurNickname(); + FP_LIB_TABLE* libtable = Prj().PcbFootprintLibs(); const LIB_TABLE_ROW* row = libtable->FindRow( getCurNickname() ); 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" ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 0ff86b99ea..4d0fd09a00 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1245,11 +1245,19 @@ void PCB_EDIT_FRAME::UpdateTitle() wxString title; - title = ( IsContentModified() ? "*" : "" ) - + fn.GetName() + " " - + ( readOnly ? _( "[Read Only]" ) + wxS( " " ) : wxS( "" ) ) - + ( unsaved ? _( "[Unsaved]" ) + wxS( " " ) : wxS( "" ) ) - + wxT( "\u2014 " ) + _( "PCB Editor" ); + if( IsContentModified() ) + title = wxT( "*" ); + + title += fn.GetName(); + + if( readOnly ) + title += wxS( " " ) + _( "[Read Only]" ); + + if( unsaved ) + title += wxS( " " ) + _( "[Unsaved]" ); + + title += wxT( " \u2014 " ) + _( "PCB Editor" ); + SetTitle( title ); }