1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 17:07:23 +02:00
eda-tools/kicad-patches/cmdline-common.patch

117 lines
3.9 KiB
Diff
Raw Normal View History

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
2012-01-11 12:50:47 +02:00
@@ -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 @@
2012-01-11 12:50:47 +02:00
bool ExportToDxfFile( const wxString& aFullFileName,
int aLayer,
+ bool aPlotOriginIsAuxAxis,
EDA_DRAW_MODE_T aTraceMode );
2012-01-11 12:50:47 +02:00
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 @@
2012-01-11 12:50:47 +02:00
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 @@
2012-01-11 12:50:47 +02:00
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 <dialog_exit_base.h>
#include <bitmaps.h>
2012-01-25 13:32:10 +02:00
2012-01-25 14:20:03 +02:00
+bool g_CmdLineMode = false;
+
class DIALOG_EXIT: public DIALOG_EXIT_BASE
{
public:
@@ -42,6 +44,12 @@
2012-01-25 14:20:03 +02:00
{
wxMessageDialog* dialog;
2012-01-25 13:32:10 +02:00
2012-01-25 14:20:03 +02:00
+ 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 @@
2012-01-25 14:20:03 +02:00
{
wxMessageDialog* dialog;
2012-01-25 13:32:10 +02:00
2012-01-25 14:20:03 +02:00
+ if (g_CmdLineMode)
+ {
+ wxPrintf( text + _( "\n" ) );
+ return;
+ }
+
dialog = new wxMessageDialog( parent, text, _( "Info:" ),
wxOK | wxCENTRE | wxICON_INFORMATION );
2012-01-25 13:32:10 +02:00
@@ -69,6 +83,12 @@
2012-01-25 14:20:03 +02:00
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
2012-01-25 14:20:03 +02:00
@@ -306,6 +306,7 @@
wxString EnvLang;
2012-01-25 13:32:10 +02:00
2012-01-25 14:20:03 +02:00
m_Id = aId;
+if (!g_CmdLineMode)
m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() );
2012-01-25 13:32:10 +02:00
2012-01-25 14:20:03 +02:00
/* Init KiCad environment