1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-07-02 20:38:33 +03:00
eda-tools/kicad-patches/scripted-common.patch

80 lines
2.5 KiB
Diff

diff -ruN kicad.orig/common/confirm.cpp kicad/common/confirm.cpp
--- kicad.orig/common/confirm.cpp 2010-10-19 08:48:07.000000000 +0000
+++ kicad/common/confirm.cpp 2011-01-02 13:04:39.339823004 +0000
@@ -66,6 +66,7 @@
* See not above as to why this doesn't work. */
}
+bool g_IsScripted = false;
/* Display an error or warning message.
* If display time > 0 the dialog disappears after displayTime 0.1 seconds
@@ -75,6 +76,12 @@
{
wxMessageDialog* dialog;
+ if (g_IsScripted)
+ {
+ wxFprintf( stderr, text + _("\n") );
+ return;
+ }
+
if( displaytime > 0 )
dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ),
wxOK | wxICON_INFORMATION,
@@ -95,6 +102,11 @@
{
wxMessageDialog* dialog;
+ if (g_IsScripted)
+ {
+ wxPrintf( text + _("\n") );
+ return;
+ }
dialog = new WinEDA_MessageDialog( parent, text, _( "Info:" ),
wxOK | wxICON_INFORMATION, displaytime );
diff -ruN kicad.orig/common/edaappl.cpp kicad/common/edaappl.cpp
--- kicad.orig/common/edaappl.cpp 2010-10-19 08:48:07.000000000 +0000
+++ kicad/common/edaappl.cpp 2011-01-02 13:04:39.343823004 +0000
@@ -272,6 +272,7 @@
wxString EnvLang;
m_Id = aId;
+if (!g_IsScripted)
m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) +
wxGetUserId() );
diff -ruN kicad.orig/include/appl_wxstruct.h kicad/include/appl_wxstruct.h
--- kicad.orig/include/appl_wxstruct.h 2010-10-19 08:48:07.000000000 +0000
+++ kicad/include/appl_wxstruct.h 2011-01-02 15:13:47.532837657 +0000
@@ -32,6 +32,8 @@
/* Class representing the entire Application */
/**********************************************/
+extern bool g_IsScripted;
+
class WinEDA_App : public wxApp
{
public:
@@ -95,6 +97,8 @@
void InitEDA_Appl( const wxString& aName,
id_app_type aId = APP_TYPE_UNKOWN );
+ virtual int OnRun() { return g_IsScripted ? 0 : wxApp::OnRun(); }
+
bool SetLanguage( bool first_time = FALSE );
/** Function AddMenuLanguageList
diff -ruN kicad.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h
--- kicad.orig/include/wxPcbStruct.h 2010-10-19 08:48:07.000000000 +0000
+++ kicad/include/wxPcbStruct.h 2011-01-02 13:04:39.399823002 +0000
@@ -50,6 +50,7 @@
class WinEDA_PcbFrame : public WinEDA_BasePcbFrame
{
friend class PCB_LAYER_WIDGET;
+ friend bool Pcbnew_Scripted();
protected: