1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-17 20:04:05 +02:00
eda-tools/kicad-patches/cmdline-common.patch

103 lines
3.4 KiB
Diff

diff -ru kicad.orig/common/confirm.cpp kicad/common/confirm.cpp
--- kicad.orig/common/confirm.cpp 2012-01-02 15:12:29.461843000 +0100
+++ kicad/common/confirm.cpp 2012-01-04 00:59:04.412020890 +0100
@@ -9,11 +9,18 @@
#include "wx/html/htmlwin.h"
#include "html_messagebox.h"
+bool g_CmdLineMode = false;
void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
{
wxMessageDialog* dialog;
+ if (g_CmdLineMode)
+ {
+ wxFprintf( stderr, text + _( "\n" ) );
+ return;
+ }
+
if( displaytime > 0 )
dialog = new wxMessageDialog( parent, text, _( "Warning" ),
wxOK | wxCENTRE | wxICON_INFORMATION );
@@ -30,6 +37,12 @@
{
wxMessageDialog* dialog;
+ if (g_CmdLineMode)
+ {
+ wxPrintf( text + _( "\n" ) );
+ return;
+ }
+
dialog = new wxMessageDialog( parent, text, _( "Info:" ),
wxOK | wxCENTRE | wxICON_INFORMATION );
@@ -41,6 +54,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.orig/common/edaappl.cpp kicad/common/edaappl.cpp
--- kicad.orig/common/edaappl.cpp 2012-01-02 15:12:29.461843000 +0100
+++ kicad/common/edaappl.cpp 2012-01-04 00:58:45.466217466 +0100
@@ -306,6 +306,7 @@
wxString EnvLang;
m_Id = aId;
+if (!g_CmdLineMode)
m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() );
/* Init KiCad environment
diff -ru kicad.orig/include/appl_wxstruct.h kicad/include/appl_wxstruct.h
--- kicad.orig/include/appl_wxstruct.h 2012-01-02 15:12:29.461843000 +0100
+++ kicad/include/appl_wxstruct.h 2012-01-04 00:58:00.447684901 +0100
@@ -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.orig/include/wxEeschemaStruct.h kicad/include/wxEeschemaStruct.h
--- kicad.orig/include/wxEeschemaStruct.h 2012-01-02 15:12:29.461843000 +0100
+++ kicad/include/wxEeschemaStruct.h 2012-01-04 02:04:17.560214904 +0100
@@ -585,6 +585,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.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h
--- kicad.orig/include/wxPcbStruct.h 2012-01-02 15:12:29.461843000 +0100
+++ kicad/include/wxPcbStruct.h 2012-01-10 17:49:51.848114042 +0100
@@ -75,6 +75,7 @@
class PCB_EDIT_FRAME : public PCB_BASE_FRAME
{
friend class PCB_LAYER_WIDGET;
+ friend bool Pcbnew_CmdLine();
void updateTraceWidthSelectBox();
void updateViaSizeSelectBox();