diff -ru kicad.3493/include/appl_wxstruct.h kicad/include/appl_wxstruct.h --- kicad.3493/include/appl_wxstruct.h 2012-04-08 03:24:18.653600000 +0200 +++ kicad/include/appl_wxstruct.h 2012-04-08 06:48:52.439995635 +0200 @@ -52,6 +52,7 @@ class wxSingleInstanceChecker; class wxHtmlHelpController; +extern bool g_CmdLineMode; /** * Class EDA_APP @@ -185,6 +186,8 @@ */ void InitEDA_Appl( const wxString& aName, EDA_APP_T aId = APP_UNKNOWN_T ); + virtual int OnRun() { return g_CmdLineMode ? 0 : wxApp::OnRun(); } + /** * Function SetLanguage * sets the dictionary file name for internationalization. diff -ru kicad.3493/include/wxBasePcbFrame.h kicad/include/wxBasePcbFrame.h --- kicad.3493/include/wxBasePcbFrame.h 2012-04-08 03:24:18.653600000 +0200 +++ kicad/include/wxBasePcbFrame.h 2012-04-08 06:48:52.440995630 +0200 @@ -571,6 +571,7 @@ bool ExportToDxfFile( const wxString& aFullFileName, int aLayer, + bool aPlotOriginIsAuxAxis, EDA_DRAW_MODE_T aTraceMode ); void Plot_Layer( PLOTTER* plotter, diff -ru kicad.3493/include/wxEeschemaStruct.h kicad/include/wxEeschemaStruct.h --- kicad.3493/include/wxEeschemaStruct.h 2012-04-08 03:24:18.653600000 +0200 +++ kicad/include/wxEeschemaStruct.h 2012-04-08 06:48:52.442995618 +0200 @@ -595,6 +595,8 @@ void SVG_Print( wxCommandEvent& event ); // Plot functions: + void CmdLineToPlot_PS( bool PlotBW, bool PlotSheetRef ); + void CmdLineToPlot_DXF( bool PlotBW, bool PlotSheetRef ); void ToPlot_PS( wxCommandEvent& event ); void ToPlot_HPGL( wxCommandEvent& event ); void ToPlot_DXF( wxCommandEvent& event ); diff -ru kicad.3493/include/wxPcbStruct.h kicad/include/wxPcbStruct.h --- kicad.3493/include/wxPcbStruct.h 2012-04-08 03:24:18.653600000 +0200 +++ kicad/include/wxPcbStruct.h 2012-04-08 06:48:52.445995601 +0200 @@ -74,6 +74,7 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME { friend class PCB_LAYER_WIDGET; + friend bool Pcbnew_CmdLine(); void updateTraceWidthSelectBox(); void updateViaSizeSelectBox(); diff -ru kicad.3493/common/confirm.cpp kicad/common/confirm.cpp --- kicad.3493/common/confirm.cpp 2012-04-08 03:24:18.653600000 +0200 +++ kicad/common/confirm.cpp 2012-04-08 06:49:55.618649886 +0200 @@ -11,6 +11,8 @@ #include #include +bool g_CmdLineMode = false; + class DIALOG_EXIT: public DIALOG_EXIT_BASE { public: @@ -42,6 +44,12 @@ { wxMessageDialog* dialog; + if (g_CmdLineMode) + { + wxFprintf( stderr, text + _( "\n" ) ); + return; + } + if( displaytime > 0 ) dialog = new wxMessageDialog( parent, text, _( "Warning" ), wxOK | wxCENTRE | wxICON_INFORMATION ); @@ -58,6 +66,12 @@ { wxMessageDialog* dialog; + if (g_CmdLineMode) + { + wxPrintf( text + _( "\n" ) ); + return; + } + dialog = new wxMessageDialog( parent, text, _( "Info:" ), wxOK | wxCENTRE | wxICON_INFORMATION ); @@ -69,6 +83,12 @@ void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title, const wxString& text, const wxSize& size ) { + if (g_CmdLineMode) + { + wxPrintf( title + _( "\n" ) + text + _( "\n" ) ); + return; + } + HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX(parent,title, wxDefaultPosition, size ); dlg->AddHTML_Text( text ); dlg->ShowModal(); diff -ru kicad.3493/common/edaappl.cpp kicad/common/edaappl.cpp --- kicad.3493/common/edaappl.cpp 2012-04-08 03:24:18.653600000 +0200 +++ kicad/common/edaappl.cpp 2012-04-08 06:48:52.448995586 +0200 @@ -306,6 +306,7 @@ wxString EnvLang; m_Id = aId; +if (!g_CmdLineMode) m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() ); /* Init KiCad environment