Commit ba92f94f authored by dickelbeck's avatar dickelbeck

ProcessExecute instead of wxExecute

parent 080746ac
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "common.h" #include "common.h"
#include "macros.h" #include "macros.h"
#include "build_version.h" #include "build_version.h"
#include <wx/process.h>
/*****************************/ /*****************************/
wxString GetBuildVersion() wxString GetBuildVersion()
...@@ -30,7 +30,9 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS ...@@ -30,7 +30,9 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS
/*********************************************************************************************/ /*********************************************************************************************/
{ {
// All sizes are in 1/1000 inch // All sizes are in 1/1000 inch
m_Size = size; m_Offset = offset, m_Name = name; m_Size = size;
m_Offset = offset;
m_Name = name;
// Adjust the default value for margins to 400 mils (0,4 inch or 10 mm) // Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
m_LeftMargin = m_RightMargin = m_TopMargin = m_BottomMargin = 400; m_LeftMargin = m_RightMargin = m_TopMargin = m_BottomMargin = 400;
...@@ -205,6 +207,7 @@ wxString GenDate() ...@@ -205,6 +207,7 @@ wxString GenDate()
wxT( "jan" ), wxT( "feb" ), wxT( "mar" ), wxT( "apr" ), wxT( "may" ), wxT( "jun" ), wxT( "jan" ), wxT( "feb" ), wxT( "mar" ), wxT( "apr" ), wxT( "may" ), wxT( "jun" ),
wxT( "jul" ), wxT( "aug" ), wxT( "sep" ), wxT( "oct" ), wxT( "nov" ), wxT( "dec" ) wxT( "jul" ), wxT( "aug" ), wxT( "sep" ), wxT( "oct" ), wxT( "nov" ), wxT( "dec" )
}; };
time_t buftime; time_t buftime;
struct tm* Date; struct tm* Date;
wxString string_date; wxString string_date;
...@@ -241,6 +244,14 @@ void* MyMalloc( size_t nb_octets ) ...@@ -241,6 +244,14 @@ void* MyMalloc( size_t nb_octets )
} }
bool ProcessExecute( const wxString& aCommandLine, int aFlags )
{
wxProcess* process = wxProcess::Open( aCommandLine, aFlags );
return process != NULL;
}
/************************************/ /************************************/
void* MyZMalloc( size_t nb_octets ) void* MyZMalloc( size_t nb_octets )
/************************************/ /************************************/
......
This diff is collapsed.
...@@ -533,7 +533,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para ...@@ -533,7 +533,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para
{ {
if( !param.IsEmpty() ) if( !param.IsEmpty() )
FullFileName += wxT( " " ) + param; FullFileName += wxT( " " ) + param;
wxExecute( FullFileName ); ProcessExecute( FullFileName );
return 0; return 0;
} }
...@@ -748,7 +748,7 @@ void OpenPDF( const wxString& file ) ...@@ -748,7 +748,7 @@ void OpenPDF( const wxString& file )
} }
if( !command.IsEmpty() ) if( !command.IsEmpty() )
wxExecute( command ); ProcessExecute( command );
} }
...@@ -771,5 +771,5 @@ void OpenFile( const wxString& file ) ...@@ -771,5 +771,5 @@ void OpenFile( const wxString& file )
delete filetype; delete filetype;
if( success && !command.IsEmpty() ) if( success && !command.IsEmpty() )
wxExecute( command ); ProcessExecute( command );
} }
...@@ -342,7 +342,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame, ...@@ -342,7 +342,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
CommandFile += wxT( " " ) + TmpFullFileName; CommandFile += wxT( " " ) + TmpFullFileName;
CommandFile += wxT( " " ) + FullFileName; CommandFile += wxT( " " ) + FullFileName;
wxExecute( CommandFile, wxEXEC_SYNC ); ProcessExecute( CommandFile, wxEXEC_SYNC );
} }
......
...@@ -354,6 +354,18 @@ class WinEDA_DrawPanel; ...@@ -354,6 +354,18 @@ class WinEDA_DrawPanel;
/* COMMON.CPP */ /* COMMON.CPP */
/**
* Function ProcessExecute
* runs a child process.
* @param aCommandLine The process and any arguments to it all in a single string.
* @param aFlags The same args as allowed for wxExecute()
* @return bool - true if success, else false
*/
bool ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC );
wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE ); wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE );
/* Return the name of the layer number "layer_number". /* Return the name of the layer number "layer_number".
......
...@@ -305,7 +305,7 @@ void dialog_freeroute_exchange::OnButton5Click( wxCommandEvent& event ) ...@@ -305,7 +305,7 @@ void dialog_freeroute_exchange::OnButton5Click( wxCommandEvent& event )
if( wxFileExists( FullFileName ) ) if( wxFileExists( FullFileName ) )
{ {
command << wxT("javaws") << wxT( " " ) + FullFileName; command << wxT("javaws") << wxT( " " ) + FullFileName;
wxExecute( command ); ProcessExecute( command );
return; return;
} }
......
...@@ -134,7 +134,7 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC ) ...@@ -134,7 +134,7 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC )
Affiche_Message( ExecFileName ); Affiche_Message( ExecFileName );
wxExecute( ExecFileName ); ProcessExecute( ExecFileName );
#else #else
wxMessageBox( wxT( "TODO, currently not available" ) ); wxMessageBox( wxT( "TODO, currently not available" ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment