← Back to team overview

kicad-developers team mailing list archive

Small cosmetic patch for windows titles

 

Hi list,

here is a small patch that keeps the version information out of windows
titles for a release build, but lets them for debug builds.

I did this because I could never see the useful part of the file name in
windows titles.

Have a nice day,

-- 
Charles
=== modified file 'cvpcb/cvframe.cpp'
--- cvpcb/cvframe.cpp	2014-03-06 08:42:16 +0000
+++ cvpcb/cvframe.cpp	2014-03-17 11:54:15 +0000
@@ -781,16 +781,24 @@
 
     if( m_NetlistFileName.IsOk() && m_NetlistFileName.FileExists() )
     {
+#ifdef DEBUG
         title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
-                wxT( " " ) + m_NetlistFileName.GetFullPath();
+	    wxT( " " ) + m_NetlistFileName.GetFullPath();
+#else
+	title = wxGetApp().GetTitle() + wxT( " " ) + m_NetlistFileName.GetFullPath();
+#endif
 
         if( !m_NetlistFileName.IsFileWritable() )
             title += _( " [Read Only]" );
     }
     else
     {
+#ifdef DEBUG
         title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
                 wxT( " " ) + _( " [no file]" );
+#else
+	title = wxGetApp().GetTitle() + wxT( " " ) + _( " [no file]" );
+#endif
     }
 
     SetTitle( title );
@@ -883,8 +891,11 @@
     COMPONENT*  component;
     FILE*       outputFile;
     wxFileName  fn( aFullFileName );
+#ifdef DEBUG
     wxString    Title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion();
-
+#else
+    wxString    Title = wxGetApp().GetTitle();
+#endif
     outputFile = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
 
     if( outputFile == NULL )

=== modified file 'cvpcb/cvpcb.cpp'
--- cvpcb/cvpcb.cpp	2014-02-21 10:05:28 +0000
+++ cvpcb/cvpcb.cpp	2014-03-17 11:54:50 +0000
@@ -124,7 +124,11 @@
 
     g_DrawBgColor = BLACK;
 
+#ifdef DEBUG
     wxString Title = GetTitle() + wxT( " " ) + GetBuildVersion();
+    #else
+    wxString Title = GetTitle();
+#endif
     frame = new CVPCB_MAINFRAME( Title );
 
     // Show the frame

=== modified file 'eeschema/backanno.cpp'
--- eeschema/backanno.cpp	2013-03-30 17:49:58 +0000
+++ eeschema/backanno.cpp	2014-03-17 11:56:47 +0000
@@ -145,7 +145,11 @@
         return false;
 
     wxString filename = dlg.GetPath();
+#ifdef DEBUG
     wxString title  = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
+#else
+    wxString title  = wxGetApp().GetAppName();
+#endif    
     title += wxT( " " ) + filename;
     SetTitle( title );
 

=== modified file 'eeschema/netform.cpp'
--- eeschema/netform.cpp	2014-01-28 10:59:04 +0000
+++ eeschema/netform.cpp	2014-03-17 11:57:55 +0000
@@ -644,9 +644,12 @@
     xdesign->AddChild( node( wxT( "date" ), DateAndTime() ) );
 
     // which Eeschema tool
+#ifdef DEBUG
     xdesign->AddChild( node( wxT( "tool" ), wxGetApp().GetAppName() + wxChar(' ') +
                              GetBuildVersion() ) );
-
+#else
+    xdesign->AddChild( node( wxT( "tool" ), wxGetApp().GetAppName() ) );
+#endif
     /*  @todo might do a list of schematic pages
 
         <page name="">
@@ -1728,8 +1731,11 @@
     SCH_SHEET_PATH* sheet;
     EDA_ITEM* DrawList;
     SCH_COMPONENT* Component;
+#ifdef DEBUG
     wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
-
+#else
+    wxString Title = wxGetApp().GetAppName();
+#endif
     ret |= fprintf( f, "%sHEA\n", TO_UTF8( StartLine ) );
     ret |= fprintf( f, "%sTIM %s\n", TO_UTF8( StartLine ), TO_UTF8( DateAndTime() ) );
     ret |= fprintf( f, "%sAPP ", TO_UTF8( StartLine ) );

=== modified file 'eeschema/schframe.cpp'
--- eeschema/schframe.cpp	2014-03-06 08:42:16 +0000
+++ eeschema/schframe.cpp	2014-03-17 12:03:33 +0000
@@ -1000,8 +1000,12 @@
 
     if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
     {
-        title.Printf( wxT( "Eeschema %s [%s]" ), GetChars( GetBuildVersion() ),
+#ifdef DEBUG
+	    title.Printf( wxT( "Eeschema %s [%s]" ), GetChars( GetBuildVersion() ),
                             GetChars( GetScreen()->GetFileName() ) );
+#else
+	    title.Printf( wxT( "Eeschema [%s]" ), GetChars( GetScreen()->GetFileName() ) );
+#endif
     }
     else
     {

=== modified file 'gerbview/gerbview.cpp'
--- gerbview/gerbview.cpp	2014-02-07 08:52:47 +0000
+++ gerbview/gerbview.cpp	2014-03-17 11:58:35 +0000
@@ -106,8 +106,11 @@
     frame = new  GERBVIEW_FRAME( NULL, wxT( "GerbView" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
 
     /* Gerbview mainframe title */
+#ifdef DEBUG
     frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
-
+#else
+    frame->SetTitle( GetTitle() );
+#endif
     SetTopWindow( frame );                  // Set GerbView mainframe on top
     frame->Show( true );                    // Show GerbView mainframe
     frame->Zoom_Automatique( true );        // Zoom fit in frame

=== modified file 'gerbview/gerbview_frame.cpp'
--- gerbview/gerbview_frame.cpp	2014-02-07 08:52:47 +0000
+++ gerbview/gerbview_frame.cpp	2014-03-17 11:59:52 +0000
@@ -463,7 +463,11 @@
     // Display the gerber filename
     if( gerber == NULL )
     {
-        text.Printf( wxT( "GerbView %s" ), GetChars( GetBuildVersion() ) );
+#ifdef DEBUG
+	text.Printf( wxT( "GerbView %s" ), GetChars( GetBuildVersion() ) );
+#else
+	text.Printf( wxT( "GerbView %s" ) );
+#endif
         SetTitle( text );
         SetStatusText( wxEmptyString, 0 );
         text.Printf( _( "Layer %d not in use" ), getActiveLayer() + 1 );

=== modified file 'kicad/kicad.cpp'
--- kicad/kicad.cpp	2014-02-07 08:52:47 +0000
+++ kicad/kicad.cpp	2014-03-17 12:00:41 +0000
@@ -68,9 +68,12 @@
 
     frame->OnLoadProject( loadEvent );
 
+#ifdef DEBUG 
     wxString title = GetTitle() + wxT( " " ) + GetBuildVersion() +
                      wxT( " " ) + frame->m_ProjectFileName.GetFullPath();
-
+#else
+    wxString title = GetTitle() + wxT( " " ) + frame->m_ProjectFileName.GetFullPath();
+#endif
     if( !fn.IsDirWritable() )
         title += _( " [Read Only]" );
 

=== modified file 'kicad/prjconfig.cpp'
--- kicad/prjconfig.cpp	2014-02-21 10:05:28 +0000
+++ kicad/prjconfig.cpp	2014-03-17 12:01:21 +0000
@@ -274,8 +274,12 @@
     wxGetApp().ReadProjectConfig( m_ProjectFileName.GetFullPath(),
                                   GeneralGroupName, s_KicadManagerParams, false );
 
+#ifdef DEBUG
     title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
         wxT( " " ) +  m_ProjectFileName.GetFullPath();
+#else
+    title = wxGetApp().GetTitle() + wxT( " " ) +  m_ProjectFileName.GetFullPath();
+#endif
 
     if( !m_ProjectFileName.IsDirWritable() )
         title += _( " [Read Only]" );

=== modified file 'pagelayout_editor/pl_editor.cpp'
--- pagelayout_editor/pl_editor.cpp	2014-02-07 08:52:47 +0000
+++ pagelayout_editor/pl_editor.cpp	2014-03-17 12:02:43 +0000
@@ -88,8 +88,11 @@
     PL_EDITOR_FRAME * frame = new PL_EDITOR_FRAME( NULL, wxT( "PlEditorFrame" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
 
     // frame title:
+#ifdef DEBUG
     frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
-
+#else
+    frame->SetTitle( GetTitle() );
+#endif
     SetTopWindow( frame );
     frame->Show( true );
     frame->Zoom_Automatique( true );        // Zoom fit in frame

=== modified file 'pagelayout_editor/pl_editor_frame.cpp'
--- pagelayout_editor/pl_editor_frame.cpp	2014-01-28 09:43:55 +0000
+++ pagelayout_editor/pl_editor_frame.cpp	2014-03-17 12:02:12 +0000
@@ -303,8 +303,12 @@
 void PL_EDITOR_FRAME::UpdateTitleAndInfo()
 {
     wxString title;
+#ifdef DEBUG
     title.Printf( wxT( "Pl_Editor %s [%s]" ), GetChars( GetBuildVersion() ),
-        GetChars( GetCurrFileName() ) );
+    GetChars( GetCurrFileName() ) );
+#else
+    title.Printf( wxT( "Pl_Editor [%s]" ), GetChars( GetCurrFileName() ) );
+#endif
     SetTitle( title );
 }
 

=== modified file 'pcbnew/pcbframe.cpp'
--- pcbnew/pcbframe.cpp	2014-03-06 08:42:16 +0000
+++ pcbnew/pcbframe.cpp	2014-03-17 13:04:02 +0000
@@ -1129,9 +1129,11 @@
 {
     wxString title;
     wxFileName fileName = GetBoard()->GetFileName();
-
+#ifdef DEBUG
     title.Printf( wxT( "Pcbnew %s " ), GetChars( GetBuildVersion() ) );
-
+#else
+    title.Printf( wxT( "Pcbnew " ));
+#endif
     if( fileName.IsOk() && fileName.FileExists() )
     {
         title << fileName.GetFullPath();


Follow ups