Root/kicad-patches/cmdline-common.patch

1diff -ru kicad.3493/include/appl_wxstruct.h kicad/include/appl_wxstruct.h
2--- kicad.3493/include/appl_wxstruct.h 2012-04-08 03:24:18.653600000 +0200
3+++ kicad/include/appl_wxstruct.h 2012-04-08 06:48:52.439995635 +0200
4@@ -52,6 +52,7 @@
5 class wxSingleInstanceChecker;
6 class wxHtmlHelpController;
7 
8+extern bool g_CmdLineMode;
9 
10 /**
11  * Class EDA_APP
12@@ -185,6 +186,8 @@
13      */
14     void InitEDA_Appl( const wxString& aName, EDA_APP_T aId = APP_UNKNOWN_T );
15 
16+ virtual int OnRun() { return g_CmdLineMode ? 0 : wxApp::OnRun(); }
17+
18     /**
19      * Function SetLanguage
20      * sets the dictionary file name for internationalization.
21diff -ru kicad.3493/include/wxBasePcbFrame.h kicad/include/wxBasePcbFrame.h
22--- kicad.3493/include/wxBasePcbFrame.h 2012-04-08 03:24:18.653600000 +0200
23+++ kicad/include/wxBasePcbFrame.h 2012-04-08 06:48:52.440995630 +0200
24@@ -571,6 +571,7 @@
25 
26     bool ExportToDxfFile( const wxString& aFullFileName,
27                           int aLayer,
28+ bool aPlotOriginIsAuxAxis,
29                           EDA_DRAW_MODE_T aTraceMode );
30 
31     void Plot_Layer( PLOTTER* plotter,
32diff -ru kicad.3493/include/wxEeschemaStruct.h kicad/include/wxEeschemaStruct.h
33--- kicad.3493/include/wxEeschemaStruct.h 2012-04-08 03:24:18.653600000 +0200
34+++ kicad/include/wxEeschemaStruct.h 2012-04-08 06:48:52.442995618 +0200
35@@ -595,6 +595,8 @@
36     void SVG_Print( wxCommandEvent& event );
37 
38     // Plot functions:
39+ void CmdLineToPlot_PS( bool PlotBW, bool PlotSheetRef );
40+ void CmdLineToPlot_DXF( bool PlotBW, bool PlotSheetRef );
41     void ToPlot_PS( wxCommandEvent& event );
42     void ToPlot_HPGL( wxCommandEvent& event );
43     void ToPlot_DXF( wxCommandEvent& event );
44diff -ru kicad.3493/include/wxPcbStruct.h kicad/include/wxPcbStruct.h
45--- kicad.3493/include/wxPcbStruct.h 2012-04-08 03:24:18.653600000 +0200
46+++ kicad/include/wxPcbStruct.h 2012-04-08 06:48:52.445995601 +0200
47@@ -74,6 +74,7 @@
48 class PCB_EDIT_FRAME : public PCB_BASE_FRAME
49 {
50     friend class PCB_LAYER_WIDGET;
51+ friend bool Pcbnew_CmdLine();
52 
53     void updateTraceWidthSelectBox();
54     void updateViaSizeSelectBox();
55diff -ru kicad.3493/common/confirm.cpp kicad/common/confirm.cpp
56--- kicad.3493/common/confirm.cpp 2012-04-08 03:24:18.653600000 +0200
57+++ kicad/common/confirm.cpp 2012-04-08 06:49:55.618649886 +0200
58@@ -11,6 +11,8 @@
59 #include <dialog_exit_base.h>
60 #include <bitmaps.h>
61 
62+bool g_CmdLineMode = false;
63+
64 class DIALOG_EXIT: public DIALOG_EXIT_BASE
65 {
66 public:
67@@ -42,6 +44,12 @@
68 {
69     wxMessageDialog* dialog;
70 
71+ if (g_CmdLineMode)
72+ {
73+ wxFprintf( stderr, text + _( "\n" ) );
74+ return;
75+ }
76+
77     if( displaytime > 0 )
78         dialog = new wxMessageDialog( parent, text, _( "Warning" ),
79                                       wxOK | wxCENTRE | wxICON_INFORMATION );
80@@ -58,6 +66,12 @@
81 {
82     wxMessageDialog* dialog;
83 
84+ if (g_CmdLineMode)
85+ {
86+ wxPrintf( text + _( "\n" ) );
87+ return;
88+ }
89+
90     dialog = new wxMessageDialog( parent, text, _( "Info:" ),
91                                   wxOK | wxCENTRE | wxICON_INFORMATION );
92 
93@@ -69,6 +83,12 @@
94 void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title,
95                              const wxString& text, const wxSize& size )
96 {
97+ if (g_CmdLineMode)
98+ {
99+ wxPrintf( title + _( "\n" ) + text + _( "\n" ) );
100+ return;
101+ }
102+
103     HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX(parent,title, wxDefaultPosition, size );
104     dlg->AddHTML_Text( text );
105     dlg->ShowModal();
106diff -ru kicad.3493/common/edaappl.cpp kicad/common/edaappl.cpp
107--- kicad.3493/common/edaappl.cpp 2012-04-08 03:24:18.653600000 +0200
108+++ kicad/common/edaappl.cpp 2012-04-08 06:48:52.448995586 +0200
109@@ -306,6 +306,7 @@
110     wxString EnvLang;
111 
112     m_Id = aId;
113+if (!g_CmdLineMode)
114     m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() );
115 
116     /* Init KiCad environment
117

Archive Download this file

Branches:
master



interactive