Jeff Young 5 years ago
parent
commit
0bc7bbbadb
  1. 5
      common/page_layout/ws_painter.cpp
  2. 6
      gerbview/gerbview.cpp
  3. 6
      kicad/kicad.cpp
  4. 6
      pagelayout_editor/pl_editor.cpp
  5. 6
      pcb_calculator/pcb_calculator.cpp

5
common/page_layout/ws_painter.cpp

@ -118,8 +118,11 @@ wxString WS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase )
{
bool tokenUpdated = false;
if( token->IsSameAs( wxT( "KICAD_VERSION" ) ) )
if( token->IsSameAs( wxT( "KICAD_VERSION" ) ) && PgmOrNull() )
{
// TODO: it'd be nice to get the Python script name/version here for when
// PgmOrNull() is null...
*token = wxString::Format( wxT( "%s%s %s" ),
productName,
Pgm().App().GetAppName(),

6
gerbview/gerbview.cpp

@ -121,6 +121,12 @@ PGM_BASE& Pgm()
}
// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
PGM_BASE* PgmOrNull()
{
return process;
}
bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
{
InitSettings( new GERBVIEW_SETTINGS );

6
kicad/kicad.cpp

@ -69,6 +69,12 @@ PGM_BASE& Pgm()
}
// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
PGM_BASE* PgmOrNull()
{
return &program;
}
PGM_KICAD& PgmTop()
{
return program;

6
pagelayout_editor/pl_editor.cpp

@ -124,6 +124,12 @@ PGM_BASE& Pgm()
}
// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
PGM_BASE* PgmOrNull()
{
return process;
}
bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
{
InitSettings( new PL_EDITOR_SETTINGS );

6
pcb_calculator/pcb_calculator.cpp

@ -95,6 +95,12 @@ PGM_BASE& Pgm()
}
// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
PGM_BASE* PgmOrNull()
{
return process;
}
bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
{
InitSettings( new PCB_CALCULATOR_SETTINGS );

Loading…
Cancel
Save